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) | :: | CompName | |||
integer, | intent(in) | :: | CompOp | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(in), | optional | :: | PartLoadRatio | ||
integer, | intent(inout) | :: | CompIndex | |||
integer, | intent(in) | :: | FanOpMode | |||
real(kind=r64), | intent(in), | optional | :: | OnOffAFR | ||
real(kind=r64), | intent(in), | optional | :: | CoilCoolingHeatingPLRRatio | ||
real(kind=r64), | intent(in), | optional | :: | MaxCap | ||
real(kind=r64), | intent(in), | optional | :: | CompCyclingRatio |
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.
SUBROUTINE SimDXCoil(CompName,CompOp,FirstHVACIteration,PartLoadRatio,CompIndex,FanOpMode,OnOffAFR, CoilCoolingHeatingPLRRatio, &
MaxCap, CompCyclingRatio)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2000
! MODIFIED Don Shirey, Sept 2000, October 2001, June 2005
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Manages the simulation of a single speed on/off DX coil.
! METHODOLOGY EMPLOYED:
! NA
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT (IN) :: CompName ! name of the fan coil unit
INTEGER , INTENT (IN) :: CompOp ! compressor operation; 1=on, 0=off
LOGICAL , INTENT(IN) :: FirstHVACIteration ! True when first HVAC iteration
REAL(r64) , INTENT (IN), OPTIONAL :: PartLoadRatio ! part load ratio (for single speed cycling unit)
INTEGER , INTENT (INOUT) :: CompIndex
INTEGER , INTENT (IN) :: FanOpMode ! allows parent object to control fan mode
REAL(r64) , INTENT (IN), OPTIONAL :: OnOffAFR ! ratio of compressor on airflow to compressor off airflow
REAL(r64) , INTENT (IN), OPTIONAL :: CoilCoolingHeatingPLRRatio ! used for cycling fan RH control
REAL(r64) , INTENT (IN), OPTIONAL :: MaxCap ! maximum cooling capacity of VRF terminal units
REAL(r64) , INTENT (IN), OPTIONAL :: CompCyclingRatio ! cycling ratio of VRF condenser connected to this TU
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: Blank = ' '
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: DXCoilNum ! index of fan coil unit being simulated
REAL(r64) :: AirFlowRatio ! ratio of compressor on airflow to compressor off airflow
REAL(r64) :: CompCycRatio ! compressor cycling ratio of VRF condenser
! FLOW
! First time SimDXCoil is called, get the input for all the DX coils (condensing units)
IF (GetCoilsInputFlag) THEN
CALL GetDXCoils
GetCoilsInputFlag = .FALSE. ! Set GetInputFlag false so you don't get coil inputs again
END IF
IF (CompIndex == 0) THEN
DXCoilNum = FindItemInList(CompName,DXCoil%Name,NumDXCoils)
IF (DXCoilNum == 0) THEN
CALL ShowFatalError('DX Coil not found='//TRIM(CompName))
ENDIF
CompIndex=DXCoilNum
ELSE
DXCoilNum=CompIndex
IF (DXCoilNum > NumDXCoils .or. DXCoilNum < 1) THEN
CALL ShowFatalError('SimDXCoil: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXCoilNum))// &
', Number of DX Coils='//TRIM(TrimSigDigits(NumDXCoils))// &
', Coil name='//TRIM(CompName))
ENDIF
IF (CheckEquipName(DXCoilNum)) THEN
IF (CompName /= Blank .AND. CompName /= DXCoil(DXCoilNum)%Name) THEN
CALL ShowFatalError('SimDXCoil: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXCoilNum))// &
', Coil name='//TRIM(CompName)//', stored Coil Name for that index='// &
TRIM(DXCoil(DXCoilNum)%Name))
ENDIF
CheckEquipName(DXCoilNum)=.false.
ENDIF
ENDIF
IF (PRESENT(OnOffAFR)) THEN
AirFlowRatio = OnOffAFR
ELSE
AirFlowRatio = 1.0d0
END IF
IF(PRESENT(CompCyclingRatio))THEN
CompCycRatio = CompCyclingRatio
ELSE
CompCycRatio = 1.0d0
END IF
CurDXCoilNum = DXCoilNum
! Initialize the DX coil unit
CALL InitDXCoil(DXCoilNum)
! Select the correct unit type
SELECT CASE(DXCoil(DXCoilNum)%DXCoilType_Num)!Objexx:OPTIONAL PartLoadRatio, MaxCap used in this block without PRESENT check
CASE (CoilDX_CoolingSingleSpeed)
IF (PRESENT(CoilCoolingHeatingPLRRatio)) THEN
CALL CalcDoe2DXCoil(DXCoilNum,CompOp,FirstHVACIteration,PartLoadRatio, FanOpMode, &
OnOffAirFlowRatio=AirFlowRatio, CoolingHeatingPLR=CoilCoolingHeatingPLRRatio)
ELSE
CALL CalcDoe2DXCoil(DXCoilNum,CompOp,FirstHVACIteration,PartLoadRatio, FanOpMode,OnOffAirFlowRatio=AirFlowRatio)
END IF
CASE (CoilDX_HeatingEmpirical)
CALL CalcDXHeatingCoil(DXCoilNum,PartLoadRatio, FanOpMode,OnOffAirFlowRatio=AirFlowRatio)
CASE (CoilDX_HeatPumpWaterHeater)
! call the HPWHDXCoil routine to calculate water side performance set up the DX coil info for air-side calcs
CALL CalcHPWHDXCoil(DXCoilNum,PartLoadRatio)
! CALL CalcDOE2DXCoil(DXCoilNum, CompOp, FirstHVACIteration,PartLoadRatio), perform air-side calculations
CALL CalcDOE2DXCoil(DXCoilNum, 1, FirstHVACIteration,PartLoadRatio, FanOpMode)
CASE (CoilVRF_Cooling)
CALL CalcVRFCoolingCoil(DXCoilNum, 1, FirstHVACIteration,PartLoadRatio, FanOpMode, CompCycRatio, MaxCoolCap=MaxCap)
CASE (CoilVRF_Heating)
CALL CalcDXHeatingCoil(DXCoilNum,PartLoadRatio, FanOpMode, MaxHeatCap=MaxCap)
CASE DEFAULT
CALL ShowSevereError('Error detected in DX Coil='//TRIM(CompName))
CALL ShowContinueError('Invalid DX Coil Type='//TRIM(DXCoil(DXCoilNum)%DXCoilType))
CALL ShowFatalError('Preceding condition causes termination.')
END SELECT
! Update the unit outlet nodes
CALL UpdateDXCoil(DXCoilNum)
! Report the result of the simulation
CALL ReportDXCoil(DXCoilNum)
RETURN
END SUBROUTINE SimDXCoil