Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | Index | |||
integer, | intent(in) | :: | ListNum | |||
integer, | intent(in) | :: | AirDistUnitNum | |||
integer, | intent(in) | :: | PlantLoopType | |||
integer, | intent(in) | :: | PlantLoop | |||
integer, | intent(in) | :: | PlantBranch | |||
integer, | intent(in) | :: | PlantComp |
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.
SUBROUTINE UpdateZoneCompPtrArray(Index,ListNum,AirDistUnitNum,PlantLoopType,PlantLoop,PlantBranch,PlantComp)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN June 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Update Zone Component pointers
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(OUT) :: Index
INTEGER, INTENT(IN) :: ListNum
INTEGER, INTENT(IN) :: AirDistUnitNum
INTEGER, INTENT(IN) :: PlantLoopType
INTEGER, INTENT(IN) :: PlantLoop
INTEGER, INTENT(IN) :: PlantBranch
INTEGER, INTENT(IN) :: PlantComp
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
LOGICAL, SAVE :: OneTimeFlag = .TRUE.
INTEGER :: OldArrayLimit
INTEGER, SAVE :: ArrayLimit = 100
INTEGER, SAVE :: ArrayCounter = 1
IF (OneTimeFlag)THEN
ALLOCATE(ZoneCompToPlant(ArrayLimit))
ZoneCompToPlant%ZoneEqListNum = 0
ZoneCompToPlant%ZoneEqCompNum = 0
ZoneCompToPlant%PlantLoopType = 0
ZoneCompToPlant%PlantLoopNum = 0
ZoneCompToPlant%PlantLoopBranch = 0
ZoneCompToPlant%PlantLoopComp = 0
ZoneCompToPlant%FirstDemandSidePtr = 0
ZoneCompToPlant%LastDemandSidePtr = 0
ALLOCATE(TempZoneCompToPlant(ArrayLimit))
TempZoneCompToPlant%ZoneEqListNum = 0
TempZoneCompToPlant%ZoneEqCompNum = 0
TempZoneCompToPlant%PlantLoopType = 0
TempZoneCompToPlant%PlantLoopNum = 0
TempZoneCompToPlant%PlantLoopBranch = 0
TempZoneCompToPlant%PlantLoopComp = 0
TempZoneCompToPlant%FirstDemandSidePtr = 0
TempZoneCompToPlant%LastDemandSidePtr = 0
OneTimeFlag = .FALSE.
END IF
IF(ArrayCounter < ArrayLimit)THEN
Index = ArrayCounter
ZoneCompToPlant(Index)%ZoneEqListNum = ListNum
ZoneCompToPlant(Index)%ZoneEqCompNum = AirDistUnitNum
ZoneCompToPlant(Index)%PlantLoopType = PlantLoopType
ZoneCompToPlant(Index)%PlantLoopNum = PlantLoop
ZoneCompToPlant(Index)%PlantLoopBranch = PlantBranch
ZoneCompToPlant(Index)%PlantLoopComp = PlantComp
ArrayCounter = ArrayCounter + 1
ELSE
TempZoneCompToPlant = ZoneCompToPlant
DEALLOCATE(ZoneCompToPlant)
OldArrayLimit = ArrayLimit
ArrayLimit = ArrayLimit*2
ALLOCATE(ZoneCompToPlant(ArrayLimit))
ZoneCompToPlant%ZoneEqListNum = 0
ZoneCompToPlant%ZoneEqCompNum = 0
ZoneCompToPlant%PlantLoopType = 0
ZoneCompToPlant%PlantLoopNum = 0
ZoneCompToPlant%PlantLoopBranch = 0
ZoneCompToPlant%PlantLoopComp = 0
ZoneCompToPlant%FirstDemandSidePtr = 0
ZoneCompToPlant%LastDemandSidePtr = 0
ZoneCompToPlant(1:OldArrayLimit) = TempZoneCompToPlant(1:OldArrayLimit)
DEALLOCATE(TempZoneCompToPlant)
ALLOCATE(TempZoneCompToPlant(ArrayLimit))
TempZoneCompToPlant%ZoneEqListNum = 0
TempZoneCompToPlant%ZoneEqCompNum = 0
TempZoneCompToPlant%PlantLoopType = 0
TempZoneCompToPlant%PlantLoopNum = 0
TempZoneCompToPlant%PlantLoopBranch = 0
TempZoneCompToPlant%PlantLoopComp = 0
TempZoneCompToPlant%FirstDemandSidePtr = 0
TempZoneCompToPlant%LastDemandSidePtr = 0
Index = ArrayCounter
ZoneCompToPlant(Index)%ZoneEqListNum = ListNum
ZoneCompToPlant(Index)%ZoneEqCompNum = AirDistUnitNum
ZoneCompToPlant(Index)%PlantLoopType = PlantLoopType
ZoneCompToPlant(Index)%PlantLoopNum = PlantLoop
ZoneCompToPlant(Index)%PlantLoopBranch = PlantBranch
ZoneCompToPlant(Index)%PlantLoopComp = PlantComp
ArrayCounter = ArrayCounter + 1
END IF
RETURN
END SUBROUTINE UpdateZoneCompPtrArray