| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | AirLoopNum | |||
| logical, | intent(in) | :: | FirstHVACIteration | 
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 SimAirLoopComponents( AirLoopNum, FirstHVACIteration )
          ! SUBROUTINE INFORMATION
          !             AUTHOR:  Dimitri Curtil (LBNL)
          !       DATE WRITTEN:  Feb 2006
          !           MODIFIED:
          !      RE-ENGINEERED:
          ! PURPOSE OF THIS SUBROUTINE:
          ! This simulates all components on a particular air loop in the primary air system.
          ! This code used to appear in different places in SimAirLoops(). Now consolidated
          ! into one subroutine called many times.
          ! METHODOLOGY EMPLOYED:
          ! For each branch in the air loop:
          ! (1) update branch connection with (BeforeBranchSim)
          ! (2) simulate each component
          ! (3) update branch connection with (AfterBranchSim) to enforce continuity through splitter
          !
          ! Sets current branch number to CurBranchNum defined in MODULE DataSizing
          ! Sets duct type of current branch to CurDuctType defined in MODULE DataSizing
          ! Upon exiting, resets both counters to 0.
          ! REFERENCES: None
          ! USE STATEMENTS: None
  IMPLICIT NONE
       ! SUBROUTINE ARGUMENT DEFINITIONS:
  INTEGER, INTENT(IN)     :: AirLoopNum         ! Index of the air loop being currently simulated
  LOGICAL, INTENT(IN)     :: FirstHVACIteration ! TRUE if first full HVAC iteration in an HVAC timestep
       ! SUBROUTINE PARAMETER DEFINITIONS: None
       ! INTERFACE BLOCK DEFINITIONS: None
       ! DERIVED TYPE DEFINITIONS: None
       ! SUBROUTINE LOCAL VARIABLE DEFINITIONS: None
  INTEGER                       :: BranchNum    ! Branch DO loop index
  INTEGER                       :: CompNum      ! Component DO loop index
  CHARACTER(LEN=MaxNameLength)  :: CompType     ! Component type
  CHARACTER(LEN=MaxNameLength)  :: CompName     ! Component name
  INTEGER                       :: CompType_Num ! Numeric equivalent for CompType
  DO BranchNum=1,PrimaryAirSystem(AirLoopNum)%NumBranches  ! loop over all branches in air system
    CALL UpdateBranchConnections(AirLoopNum,BranchNum,BeforeBranchSim)
    CurBranchNum = BranchNum
    CurDuctType  = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%DuctType
    ! Loop over components in branch
    DO CompNum = 1,PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%TotalComponents
      CompType     = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%TypeOf
      CompName     = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%Name
      CompType_Num = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%CompType_Num
      ! Simulate each component on PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Name
      CALL SimAirLoopComponent(CompName, CompType_Num,    &
                               FirstHVACIteration, AirLoopNum,  &
                               PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%CompIndex )
    END DO ! End of component loop
    ! Enforce continuity through the splitter
    CALL UpdateBranchConnections(AirLoopNum,BranchNum,AfterBranchSim)
  END DO ! End of branch loop
  CurBranchNum = 0
  CurDuctType  = 0
  RETURN
END SUBROUTINE SimAirLoopComponents