Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ControlNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
logical, | intent(in) | :: | IsConvergedFlag |
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 SaveSimpleController(ControlNum, FirstHVACIteration, IsConvergedFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Dimitri Curtil
! DATE WRITTEN April 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Updates solution trackers if simple controller is converged.
!
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ControlNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
LOGICAL, INTENT(IN) :: IsConvergedFlag
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PreviousSolutionIndex
! FLOW
! Save solution and mode for next call only if converged
IF ( IsConvergedFlag ) THEN
IF ( FirstHVACIteration ) THEN
PreviousSolutionIndex = 1
ELSE
PreviousSolutionIndex = 2
END IF
IF ( ControllerProps(ControlNum)%Mode == iModeActive ) THEN
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%DefinedFlag = .TRUE.
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%Mode = ControllerProps(ControlNum)%Mode
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%ActuatedValue = &
ControllerProps(ControlNum)%NextActuatedValue
ELSE
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%DefinedFlag = .FALSE.
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%Mode = ControllerProps(ControlNum)%Mode
ControllerProps(ControlNum)%SolutionTrackers(PreviousSolutionIndex)%ActuatedValue = &
ControllerProps(ControlNum)%NextActuatedValue
END IF
END IF
RETURN
END SUBROUTINE SaveSimpleController