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 | |||
| logical, | intent(in) | :: | FirstHVACIteration | |||
| integer, | intent(inout) | :: | CompIndex | |||
| integer, | intent(in) | :: | FanOpMode | |||
| real(kind=r64), | intent(in), | optional | :: | HXPartLoadRatio | ||
| logical, | intent(in), | optional | :: | HXUnitEnable | ||
| integer, | intent(in), | optional | :: | CompanionCoilIndex | ||
| logical, | intent(in), | optional | :: | RegenInletIsOANode | ||
| logical, | intent(in), | optional | :: | EconomizerFlag | ||
| logical, | intent(in), | optional | :: | HighHumCtrlFlag | 
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 SimHeatRecovery(CompName,FirstHVACIteration,CompIndex,FanOpMode,HXPartLoadRatio,HXUnitEnable, &
                           CompanionCoilIndex,RegenInletIsOANode,EconomizerFlag,HighHumCtrlFlag)
          ! SUBROUTINE INFORMATION:
          !       AUTHOR         Michael Wetter
          !       DATE WRITTEN   March 1999
          !       MODIFIED       Fred Buhl November 2000, R. Raustad FSEC - Feb 2009
          !       RE-ENGINEERED  na
          ! PURPOSE OF THIS SUBROUTINE:
          ! Manage the simulation of a heat recovery unit
          ! 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 heat exchanger unit
  LOGICAL,             INTENT (IN)   :: FirstHVACIteration  ! TRUE if 1st HVAC simulation of system timestep
  INTEGER,             INTENT(INOUT) :: CompIndex           ! Pointer to Component
  INTEGER,             INTENT (IN)   :: FanOpMode           ! Supply air fan operating mode
  REAL(r64), OPTIONAL, INTENT (IN)   :: HXPartLoadRatio     ! Part load ratio requested of DX compressor
  LOGICAL,   OPTIONAL, INTENT (IN)   :: HXUnitEnable        ! Flag to operate heat exchanger
  INTEGER,   OPTIONAL, INTENT (IN)   :: CompanionCoilIndex  ! index of companion cooling coil
  LOGICAL,   OPTIONAL, INTENT (IN)   :: RegenInletIsOANode  ! flag to determine if supply inlet is OA node, if so air flow cycles
  LOGICAL,   OPTIONAL, INTENT (IN)   :: EconomizerFlag      ! economizer operation flag passed by airloop or OA sys
  LOGICAL,   OPTIONAL, INTENT (IN)   :: HighHumCtrlFlag     ! high humidity control flag passed by airloop or OA sys
          ! SUBROUTINE PARAMETER DEFINITIONS:
          ! na
          ! INTERFACE BLOCK SPECIFICATIONS:
          ! na
          ! DERIVED TYPE DEFINITIONS:
          ! na
          ! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
  INTEGER      :: HeatExchNum               ! index of unit being simulated
  LOGICAL      :: HXUnitOn                  ! flag to enable heat exchanger
!unused0509  INTEGER      :: FanModeOperation          ! supply air fan operating mode
  REAL(r64)    :: PartLoadRatio             ! Part load ratio requested of DX compressor
  LOGICAL      :: RegInIsOANode             ! local variable to set RegenInletIsOANode optional argument
  INTEGER      :: CompanionCoilNum          ! Index to companion cooling coil
  IF (GetInputFlag) THEN
    CALL GetHeatRecoveryInput
    GetInputFlag=.FALSE.
  ENDIF
  ! Find the correct unit index
  IF (CompIndex == 0) THEN
    HeatExchNum = FindItemInList(CompName,ExchCond%Name,NumHeatExchangers)
    IF (HeatExchNum == 0) THEN
      CALL ShowFatalError('SimHeatRecovery: Unit not found='//TRIM(CompName))
    ENDIF
    CompIndex=HeatExchNum
  ELSE
    HeatExchNum=CompIndex
    IF (HeatExchNum > NumHeatExchangers .or. HeatExchNum < 1) THEN
      CALL ShowFatalError('SimHeatRecovery:  Invalid CompIndex passed='//  &
                          TRIM(TrimSigDigits(HeatExchNum))// &
                          ', Number of Units='//TRIM(TrimSigDigits(NumHeatExchangers))//  &
                          ', Entered Unit name='//TRIM(CompName))
    ENDIF
    IF (CheckEquipName(HeatExchNum)) THEN
      IF (CompName /= ExchCond(HeatExchNum)%Name) THEN
        CALL ShowFatalError('SimHeatRecovery: Invalid CompIndex passed='//  &
                            TRIM(TrimSigDigits(HeatExchNum))// &
                            ', Unit name='//TRIM(CompName)//', stored Unit Name for that index='//  &
                            TRIM(ExchCond(HeatExchNum)%Name))
      ENDIF
      CheckEquipName(HeatExchNum)=.false.
    ENDIF
  ENDIF
  IF(PRESENT(CompanionCoilIndex))THEN
    CompanionCoilNum = CompanionCoilIndex
  ELSE
    CompanionCoilNum = 0
  END IF
  IF( PRESENT(HXUnitEnable))THEN
    HXUnitOn = HXUnitEnable
!   When CalledFromParentObject is TRUE, this SIM routine was called by a parent object that passed in HXUnitEnable.
!   HX will use the DX coil part-load ratio (optional CompanionCoilIndex must be present) or PLR passed in if
!   not used with DX coil (optional CompanionCoilIndex must not be present).
    CalledFromParentObject = .TRUE.
  ELSE
!   HX is placed on a BRANCH, optional arguments are not passed in from SimAirServingZones.
!   HX will calculate its own part-load ratio if optional HXUnitEnable flag is not present
    HXUnitOn = .TRUE.
    CalledFromParentObject = .FALSE.
  END IF
  CALL InitHeatRecovery(HeatExchNum, CompanionCoilNum)
  ! call the correct heat exchanger calculation routine
  SELECT CASE(ExchCond(HeatExchNum)%ExchTypeNum)
    CASE (HX_AIRTOAIR_FLATPLATE)
      CALL CalcAirToAirPlateHeatExch(HeatExchNum, HXUnitOn, EconomizerFlag, HighHumCtrlFlag)
    CASE (HX_AIRTOAIR_GENERIC)
      CALL CalcAirToAirGenericHeatExch(HeatExchNum, HXUnitOn, FirstHVACIteration, EconomizerFlag, HighHumCtrlFlag)
    CASE (HX_DESICCANT_BALANCED)
      IF(PRESENT(HXPartLoadRatio))THEN
        PartLoadRatio = HXPartLoadRatio
      ELSE
        PartLoadRatio = 1.0d0
      END IF
      IF(PRESENT(RegenInletIsOANode))THEN
        RegInIsOANode = RegenInletIsOANode
      ELSE
        RegInIsOANode = .FALSE.
      END IF
      CALL CalcDesiccantBalancedHeatExch(HeatExchNum, HXUnitOn, FirstHVACIteration, FanOpMode, &
                                         PartLoadRatio, CompanionCoilNum, RegInIsOANode, EconomizerFlag, HighHumCtrlFlag)
  END SELECT
  CALL UpdateHeatRecovery(HeatExchNum)
  CALL ReportHeatRecovery(HeatExchNum)
RETURN
END SUBROUTINE SimHeatRecovery