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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ControlNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | AirLoopPass | |||
integer, | intent(in) | :: | Operation | |||
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.
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 TraceIndividualController( &
ControlNum, &
FirstHVACIteration, AirLoopPass, &
Operation, IsConvergedFlag )
! SUBROUTINE INFORMATION:
! AUTHOR Dimitri Curtil
! DATE WRITTEN January 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine writes convergence diagnostic to the trace file for the specified
! controller.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataEnvironment, ONLY : CurEnvirNum
USE General, ONLY : TrimSigDigits,LogicalToInteger
USE RootFinder, ONLY : WriteRootFinderTrace
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ControlNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
INTEGER, INTENT(IN) :: AirLoopPass
INTEGER, INTENT(IN) :: Operation ! Operation to execute
LOGICAL, INTENT(IN) :: IsConvergedFlag
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: TraceFileUnit
INTEGER :: ActuatedNode
INTEGER :: SensedNode
LOGICAL :: SkipLineFlag
! Setup individual trace file on first trace only
IF ( ControllerProps(ControlNum)%FirstTraceFlag ) THEN
CALL SetupIndividualControllerTracer(ControlNum)
ControllerProps(ControlNum)%FirstTraceFlag = .FALSE.
SkipLineFlag = .FALSE.
ELSE
SkipLineFlag = FirstHVACIteration .AND. (ControllerProps(ControlNum)%NumCalcCalls==0)
END IF
TraceFileUnit = ControllerProps(ControlNum)%TraceFileUnit
! Nothing to do if trace file not registered
IF ( TraceFileUnit <= 0 ) RETURN
! Skip a line before each new HVAC step
IF ( SkipLineFlag ) THEN
WRITE(TraceFileUnit,*)
END IF
! Set the sensed and actuated node numbers
ActuatedNode = ControllerProps(ControlNum)%ActuatedNode
SensedNode = ControllerProps(ControlNum)%SensedNode
! Write iteration stamp
WRITE(TraceFileUnit,'(2(A,A),2(A,A),4(A,A))',ADVANCE='No') &
TRIM(TrimSigDigits(CurEnvirNum)), ',', &
TRIM(TrimSigDigits(LogicalToInteger(WarmupFlag))), ',', &
TRIM(CreateHVACTimeString()), ',', &
TRIM(MakeHVACTimeIntervalString()), ',', &
TRIM(TrimSigDigits(AirLoopPass)), ',', &
TRIM(TrimSigDigits(LogicalToInteger(FirstHVACIteration))), ',', &
TRIM(TrimSigDigits(Operation)), ',', &
TRIM(TrimSigDigits(ControllerProps(ControlNum)%NumCalcCalls)), ','
! Write detailed diagnostic
SelectOperation: SELECT CASE (Operation)
CASE (iControllerOpColdStart, iControllerOpWarmRestart)
WRITE(TraceFileUnit, '(3(A,A),3(A,A),2(A,A),2(A,A),1(A,A))',ADVANCE='No') &
! Masss flow rate
TRIM(TrimSigDigits(Node(SensedNode)%MassFlowRate,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMinAvail,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMaxAvail,10)), ',', &
! Convergence analysis
TRIM(TrimSigDigits(ControllerProps(ControlNum)%ActuatedValue,10)), ',', & ! X
TRIM(TrimSigDigits(Node(SensedNode)%Temp,10)), ',', & ! Y
TRIM(TrimSigDigits(ControllerProps(ControlNum)%SetPointValue,10)), ',', & ! setpoint
' ', ',', & ! DeltaSensed = Y - YRoot
' ', ',', & ! Offset
TRIM(TrimSigDigits(ControllerProps(ControlNum)%Mode)), ',', & ! Mode
TRIM(TrimSigDigits(LogicalToInteger(IsConvergedFlag))), ',', & ! IsConvergedFlag
TRIM(TrimSigDigits(ControllerProps(ControlNum)%NextActuatedValue,10)), ','
! No trace available for root finder yet
! Skip call to WriteRootFinderTrace()
! Finally skip line
WRITE(TraceFileUnit,*)
CASE (iControllerOpIterate)
WRITE(TraceFileUnit, '(8(A,A),2(A,A),1(A,A))',ADVANCE='No') &
! Masss flow rate
TRIM(TrimSigDigits(Node(SensedNode)%MassFlowRate,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMinAvail,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMaxAvail,10)), ',', &
! Convergence analysis
TRIM(TrimSigDigits(ControllerProps(ControlNum)%ActuatedValue,10)), ',', & ! X
TRIM(TrimSigDigits(Node(SensedNode)%Temp,10)), ',', & ! Y
TRIM(TrimSigDigits(ControllerProps(ControlNum)%SetPointValue,10)), ',', & ! setpoint
TRIM(TrimSigDigits(ControllerProps(ControlNum)%DeltaSensed,10)), ',', & ! DeltaSensed = Y - YRoot
TRIM(TrimSigDigits(ControllerProps(ControlNum)%Offset,10)), ',', & ! Offset
TRIM(TrimSigDigits(ControllerProps(ControlNum)%Mode)), ',', & ! Mode
TRIM(TrimSigDigits(LogicalToInteger(IsConvergedFlag))), ',', & ! IsConvergedFlag
TRIM(TrimSigDigits(ControllerProps(ControlNum)%NextActuatedValue,10)), ','
! Append trace for root finder
CALL WriteRootFinderTrace( TraceFileUnit, RootFinders(ControlNum) )
! Finally skip line
WRITE(TraceFileUnit,*)
CASE (iControllerOpEnd)
WRITE(TraceFileUnit, '(3(A,A),5(A,A),2(A,A),1(A,A))',ADVANCE='No') &
! Masss flow rate
TRIM(TrimSigDigits(Node(SensedNode)%MassFlowRate,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMinAvail,10)), ',', &
TRIM(TrimSigDigits(Node(ActuatedNode)%MassFlowRateMaxAvail,10)), ',', &
! Convergence analysis
TRIM(TrimSigDigits(ControllerProps(ControlNum)%ActuatedValue,10)), ',', & ! X
TRIM(TrimSigDigits(Node(SensedNode)%Temp,10)), ',', & ! Y
TRIM(TrimSigDigits(ControllerProps(ControlNum)%SetPointValue,10)), ',', & ! setpoint
TRIM(TrimSigDigits(ControllerProps(ControlNum)%DeltaSensed,10)), ',', & ! DeltaSensed = Y - YRoot
TRIM(TrimSigDigits(ControllerProps(ControlNum)%Offset,10)), ',', & ! Offset
TRIM(TrimSigDigits(ControllerProps(ControlNum)%Mode)), ',', & ! Mode
TRIM(TrimSigDigits(LogicalToInteger(IsConvergedFlag))), ',', & ! IsConvergedFlag
TRIM(TrimSigDigits(ControllerProps(ControlNum)%NextActuatedValue,10)), ','
! No trace available for root finder yet
! Skip call to WriteRootFinderTrace()
! Finally skip line
WRITE(TraceFileUnit,*)
! Skip an additional line to indicate end of current HVAC step
WRITE(TraceFileUnit,*)
CASE DEFAULT
! Should never happen
CALL ShowFatalError( &
'TraceIndividualController: Invalid Operation passed='//TRIM(TrimSigDigits(Operation))// &
', Controller name='//TRIM(ControllerProps(ControlNum)%ControllerName) &
)
END SELECT SelectOperation
RETURN
END SUBROUTINE TraceIndividualController