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 DetectOscillatingZoneTemp
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer
! DATE WRITTEN August 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Oscillating temperatures between HVAC timesteps indicate that the
! simulation may be poor. Code is trying to be fast since the purpose
! is to see the impact on oscillating by trying longer time steps in
! an attempt to speed up the simulation.
!
! Note that the OscillateMagnitude threshold must be less than
! MaxZoneTempDiff since ManageHVAC keeps shortening the timestep
! until that is reached unless it goes to less than the
! MinTimeStepSys.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iZone
REAL(r64) :: NegOscillateMagnitude
LOGICAL :: isOscillate
REAL(r64) :: Diff12
REAL(r64) :: Diff23
REAL(r64) :: Diff34
LOGICAL,SAVE :: SetupOscillationOutputFlag = .TRUE.
LOGICAL :: isAnyZoneOscillating
!first time run allocate arrays and setup output variable
IF (SetupOscillationOutputFlag) THEN
ALLOCATE (ZoneTempHist(NumOfZones,4))
ZoneTempHist = 0.0d0
ALLOCATE (ZoneTempOscillate(NumOfZones))
ZoneTempOscillate = 0.0d0
!set up zone by zone variables
! CurrentModuleObject='Zone'
DO iZone = 1, NumOfZones
CALL SetupOutputVariable('Zone Oscillating Temperatures Time [hr]',ZoneTempOscillate(iZone), &
'System','Sum',Zone(iZone)%Name)
END DO
!set up a variable covering all zones
CALL SetupOutputVariable('Facility Any Zone Oscillating Temperatures Time [hr]',AnyZoneTempOscillate, &
'System','Sum','Facility')
SetupOscillationOutputFlag = .FALSE.
END IF
!precalc the negative value for performance
NegOscillateMagnitude = -OscillateMagnitude
!assume no zone is oscillating
isAnyZoneOscillating = .FALSE.
DO iZone = 1, NumOfZones
isOscillate = .FALSE.
ZoneTempHist(iZone,4) = ZoneTempHist(iZone,3)
ZoneTempHist(iZone,3) = ZoneTempHist(iZone,2)
ZoneTempHist(iZone,2) = ZoneTempHist(iZone,1)
ZoneTempHist(iZone,1) = ZT(iZone)
Diff34 = ZoneTempHist(iZone,3) - ZoneTempHist(iZone,4)
Diff23 = ZoneTempHist(iZone,2) - ZoneTempHist(iZone,3)
Diff12 = ZoneTempHist(iZone,1) - ZoneTempHist(iZone,2)
! roll out the conditionals for increased performance
IF (Diff12 .GT. OscillateMagnitude) THEN
IF (Diff23 .LT. NegOscillateMagnitude) THEN
IF (Diff34 .GT. OscillateMagnitude) THEN
isOscillate = .TRUE.
END IF
END IF
END IF
! now try the opposite sequence of swings
IF (Diff12 .LT. NegOscillateMagnitude) THEN
IF (Diff23 .GT. OscillateMagnitude) THEN
IF (Diff34 .LT. NegOscillateMagnitude) THEN
isOscillate = .TRUE.
END IF
END IF
END IF
IF (isOscillate) THEN
ZoneTempOscillate(iZone) = TimeStepSys
isAnyZoneOscillating = .TRUE.
ELSE
ZoneTempOscillate(iZone) = 0.0d0
END IF
END DO
!any zone variable
IF (isAnyZoneOscillating) THEN
AnyZoneTempOscillate = TimeStepSys
ELSE
AnyZoneTempOscillate = 0.0d0
END IF
END SUBROUTINE DetectOscillatingZoneTemp