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) | :: | iCompType | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in), | optional | :: | FirstHVACIteration | ||
logical, | intent(in), | optional | :: | FirstCall | ||
logical, | optional | :: | PlenumInletChanged |
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 SimAirZonePlenum(CompName, iCompType, CompIndex, FirstHVACIteration, FirstCall, PlenumInletChanged)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN November 2000
! MODIFIED March 2000
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages the ZonePlenum component simulation for both
! return and supply plenums.
! It is called from the SimAirLoopComponent at the system time step.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE DataZoneEquipment, ONLY: ZoneReturnPlenum_Type,ZoneSupplyPlenum_Type
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: CompName
INTEGER, INTENT(IN) :: iCompType
INTEGER, INTENT(INOUT) :: CompIndex
LOGICAL, OPTIONAL, INTENT(IN) :: FirstHVACIteration !Objexx:OPTIONAL Used without PRESENT check
LOGICAL, OPTIONAL, INTENT(IN) :: FirstCall !Objexx:OPTIONAL Used without PRESENT check
LOGICAL, OPTIONAL :: PlenumInletChanged !Objexx:OPTIONAL Used without PRESENT check
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ZonePlenumNum ! The ZonePlenum that you are currently loading input into
LOGICAL,SAVE :: GetInputFlag = .TRUE. ! Flag set to make sure you get input once
! FLOW:
! Obtains and Allocates ZonePlenum related parameters from input file
IF (GetInputFlag) THEN !First time subroutine has been entered
CALL GetZonePlenumInput
GetInputFlag=.FALSE.
END IF
SELECT CASE (iCompType)
CASE (ZoneReturnPlenum_Type) ! 'AirLoopHVAC:ReturnPlenum'
! Find the correct ZonePlenumNumber
IF (CompIndex == 0) THEN
ZonePlenumNum=FindItemInList(CompName,ZoneRetPlenCond%ZonePlenumName,NumZoneReturnPlenums)
IF (ZonePlenumNum == 0) THEN
CALL ShowFatalError('SimAirZonePlenum: AirLoopHVAC:ReturnPlenum not found='//TRIM(CompName))
ENDIF
CompIndex=ZonePlenumNum
ELSE
ZonePlenumNum=CompIndex
IF (ZonePlenumNum > NumZoneReturnPlenums .or. ZonePlenumNum < 1) THEN
CALL ShowFatalError('SimAirZonePlenum: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ZonePlenumNum))// &
', Number of AirLoopHVAC:ReturnPlenum='//TRIM(TrimSigDigits(NumZoneReturnPlenums))// &
', AirLoopHVAC:ReturnPlenum name='//TRIM(CompName))
ENDIF
IF (CheckRetEquipName(ZonePlenumNum)) THEN
IF (CompName /= ZoneRetPlenCond(ZonePlenumNum)%ZonePlenumName) THEN
CALL ShowFatalError('SimAirZonePlenum: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ZonePlenumNum))// &
', AirLoopHVAC:ReturnPlenum name='//TRIM(CompName)// &
', stored AirLoopHVAC:ReturnPlenum Name for that index='// &
TRIM(ZoneRetPlenCond(ZonePlenumNum)%ZonePlenumName))
ENDIF
CheckRetEquipName(ZonePlenumNum)=.false.
ENDIF
ENDIF
CALL InitAirZoneReturnPlenum(ZonePlenumNum) ! Initialize all ZonePlenum related parameters
CALL CalcAirZoneReturnPlenum(ZonePlenumNum)
CALL UpdateAirZoneReturnPlenum(ZonePlenumNum) ! Update the current ZonePlenum to the outlet nodes
CALL ReportZoneReturnPlenum(ZonePlenumNum)
CASE (ZoneSupplyPlenum_Type) ! 'AirLoopHVAC:SupplyPlenum'
! Find the correct ZonePlenumNumber
IF (CompIndex == 0) THEN
ZonePlenumNum=FindItemInList(CompName,ZoneSupPlenCond%ZonePlenumName,NumZoneSupplyPlenums)
IF (ZonePlenumNum == 0) THEN
CALL ShowFatalError('SimAirZonePlenum: AirLoopHVAC:SupplyPlenum not found='//TRIM(CompName))
ENDIF
CompIndex=ZonePlenumNum
ELSE
ZonePlenumNum=CompIndex
IF (ZonePlenumNum > NumZoneSupplyPlenums .or. ZonePlenumNum < 1) THEN
CALL ShowFatalError('SimAirZonePlenum: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ZonePlenumNum))// &
', Number of AirLoopHVAC:SupplyPlenum='//TRIM(TrimSigDigits(NumZoneReturnPlenums))// &
', AirLoopHVAC:SupplyPlenum name='//TRIM(CompName))
ENDIF
IF (CheckSupEquipName(ZonePlenumNum)) THEN
IF (CompName /= ZoneSupPlenCond(ZonePlenumNum)%ZonePlenumName) THEN
CALL ShowFatalError('SimAirZonePlenum: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ZonePlenumNum))// &
', AirLoopHVAC:SupplyPlenum name='//TRIM(CompName)// &
', stored AirLoopHVAC:SupplyPlenum Name for that index='// &
TRIM(ZoneSupPlenCond(ZonePlenumNum)%ZonePlenumName))
ENDIF
CheckSupEquipName(ZonePlenumNum)=.false.
ENDIF
ENDIF
CALL InitAirZoneSupplyPlenum(ZonePlenumNum, FirstHVACIteration, FirstCall) ! Initialize all ZonePlenum related parameters
CALL CalcAirZoneSupplyPlenum(ZonePlenumNum, FirstCall)
! Update the current ZonePlenum to the outlet nodes
CALL UpdateAirZoneSupplyPlenum(ZonePlenumNum, PlenumInletChanged, FirstCall)
CALL ReportZoneSupplyPlenum(ZonePlenumNum)
CASE DEFAULT
CALL ShowSevereError('SimAirZonePlenum: Errors in Plenum='//TRIM(CompName))
CALL ShowContinueError('ZonePlenum: Unhandled plenum type found:'//TRIM(TrimSigDigits(iCompType)))
CALL ShowFatalError('Preceding conditions cause termination.')
END SELECT
RETURN
END SUBROUTINE SimAirZonePlenum