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 ActivateDemandManagers
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN July 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
!
! METHODOLOGY EMPLOYED:
!
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: MgrNum
INTEGER :: LoadNum
INTEGER :: LoadPtr
INTEGER :: RotatedLoadNum
LOGICAL :: CanReduceDemand
! FLOW:
DO MgrNum = 1, NumDemandMgr
IF (DemandMgr(MgrNum)%Activate) THEN
DemandMgr(MgrNum)%Activate = .FALSE.
DemandMgr(MgrNum)%Active = .TRUE.
SELECT CASE (DemandMgr(MgrNum)%SelectionControl)
CASE (ManagerSelectionAll)
! Turn ON limiting on all loads
DO LoadNum = 1, DemandMgr(MgrNum)%NumOfLoads
LoadPtr = DemandMgr(MgrNum)%Load(LoadNum)
CALL LoadInterface(SetLimit, MgrNum, LoadPtr, CanReduceDemand)
END DO ! LoadNum
CASE (ManagerSelectionMany) ! All loads are limited except for one
IF (DemandMgr(MgrNum)%NumOfLoads > 1) THEN
! Turn ON limiting on all loads
DO LoadNum = 1, DemandMgr(MgrNum)%NumOfLoads
LoadPtr = DemandMgr(MgrNum)%Load(LoadNum)
CALL LoadInterface(SetLimit, MgrNum, LoadPtr, CanReduceDemand)
END DO ! LoadNum
! Set next rotated load (from last time it was active)
RotatedLoadNum = DemandMgr(MgrNum)%RotatedLoadNum
RotatedLoadNum = RotatedLoadNum + 1
IF (RotatedLoadNum > DemandMgr(MgrNum)%NumOfLoads) RotatedLoadNum = 1
DemandMgr(MgrNum)%RotatedLoadNum = RotatedLoadNum
! Turn OFF limiting for the new rotated load
LoadPtr = DemandMgr(MgrNum)%Load(RotatedLoadNum)
CALL LoadInterface(ClearLimit, MgrNum, LoadPtr, CanReduceDemand)
ELSE
! Turn ON limiting for the one and only load
LoadPtr = DemandMgr(MgrNum)%Load(1)
CALL LoadInterface(SetLimit, MgrNum, LoadPtr, CanReduceDemand)
END IF
CASE (ManagerSelectionOne) ! Only one load is limited
IF (DemandMgr(MgrNum)%NumOfLoads > 1) THEN
! Turn OFF limiting on all loads
DO LoadNum = 1, DemandMgr(MgrNum)%NumOfLoads
LoadPtr = DemandMgr(MgrNum)%Load(LoadNum)
CALL LoadInterface(ClearLimit, MgrNum, LoadPtr, CanReduceDemand)
END DO ! LoadNum
! Set next rotated load (from last time it was active)
RotatedLoadNum = DemandMgr(MgrNum)%RotatedLoadNum
RotatedLoadNum = RotatedLoadNum + 1
IF (RotatedLoadNum > DemandMgr(MgrNum)%NumOfLoads) RotatedLoadNum = 1
DemandMgr(MgrNum)%RotatedLoadNum = RotatedLoadNum
! Turn ON limiting for the new rotated load
LoadPtr = DemandMgr(MgrNum)%Load(RotatedLoadNum)
CALL LoadInterface(SetLimit, MgrNum, LoadPtr, CanReduceDemand)
ELSE
! Turn ON limiting for the one and only load
LoadPtr = DemandMgr(MgrNum)%Load(1)
CALL LoadInterface(SetLimit, MgrNum, LoadPtr, CanReduceDemand)
END IF
END SELECT
END IF
END DO ! MgrNum
RETURN
END SUBROUTINE ActivateDemandManagers