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.
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 CheckWarmupConvergence
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN April 1997
! MODIFIED June 2011, Daeho Kang for individual zone comparison
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine checks warmup convergence values.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: MinLoad = 100.d0 ! Minimum laods for convergence check
! To avoid big percentage difference in low load situations
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ZoneNum
LOGICAL,SAVE :: WarmupConvergenceWarning=.false.
LOGICAL,SAVE :: SizingWarmupConvergenceWarning=.false.
LOGICAL :: ConvergenceChecksFailed
! Convergence criteria for warmup days:
! Perform another warmup day unless both the % change in loads and
! absolute change in zone temp min & max are less than their criteria.
ConvergenceChecksFailed=.false.
IF (NumofZones <= 0) THEN ! if there are no zones, immediate convergence
WarmupFlag=.FALSE.
ELSE
DO ZoneNum=1,NumofZones
WarmupConvergenceValues(ZoneNum)%TestMaxTempValue=ABS(MaxTempPrevDay(ZoneNum)-MaxTempZone(ZoneNum))
WarmupConvergenceValues(ZoneNum)%TestMinTempValue=ABS(MinTempPrevDay(ZoneNum)-MinTempZone(ZoneNum))
IF (WarmupConvergenceValues(ZoneNum)%TestMaxTempValue <= TempConvergTol) THEN
WarmupConvergenceValues(ZoneNum)%PassFlag(1)=2
ELSE
ConvergenceChecksFailed=.true.
WarmupConvergenceValues(ZoneNum)%PassFlag(1)=1
ENDIF
IF (WarmupConvergenceValues(ZoneNum)%TestMinTempValue <= TempConvergTol) THEN
WarmupConvergenceValues(ZoneNum)%PassFlag(2)=2
ELSE
ConvergenceChecksFailed=.true.
WarmupConvergenceValues(ZoneNum)%PassFlag(2)=1
ENDIF
IF (MaxHeatLoadZone(ZoneNum) > 1.0d-4) THEN ! make sure load big enough to divide
MaxHeatLoadZone(ZoneNum) = ABS(Max(MaxHeatLoadZone(ZoneNum),MinLoad))
WarmupConvergenceValues(ZoneNum)%TestMaxHeatLoadValue= &
ABS((MaxHeatLoadZone(ZoneNum)-MaxHeatLoadPrevDay(ZoneNum))/MaxHeatLoadZone(ZoneNum))
IF (WarmupConvergenceValues(ZoneNum)%TestMaxHeatLoadValue <= LoadsConvergTol) THEN
WarmupConvergenceValues(ZoneNum)%PassFlag(3)=2
ELSE
ConvergenceChecksFailed=.true.
WarmupConvergenceValues(ZoneNum)%PassFlag(3)=1
END IF
ELSE
WarmupConvergenceValues(ZoneNum)%PassFlag(3)=2
END IF
IF (MaxCoolLoadZone(ZoneNum) > 1.0d-4) THEN
MaxCoolLoadZone(ZoneNum) = ABS(Max(MaxCoolLoadZone(ZoneNum),MinLoad))
WarmupConvergenceValues(ZoneNum)%TestMaxCoolLoadValue= &
ABS((MaxCoolLoadZone(ZoneNum)-MaxCoolLoadPrevDay(ZoneNum))/MaxCoolLoadZone(ZoneNum))
IF (WarmupConvergenceValues(ZoneNum)%TestMaxCoolLoadValue <= LoadsConvergTol) THEN
WarmupConvergenceValues(ZoneNum)%PassFlag(4)=2
ELSE
ConvergenceChecksFailed=.true.
WarmupConvergenceValues(ZoneNum)%PassFlag(4)=1
END IF
ELSE
WarmupConvergenceValues(ZoneNum)%PassFlag(4)=2
END IF
IF (DayOfSim >= MaxNumberOfWarmupDays .and. WarmupFlag) THEN
! Check convergence for individual zone
IF (SUM(WarmupConvergenceValues(ZoneNum)%PassFlag) /= 8) THEN ! pass=2 * 4 values for convergence
CALL ShowSevereError('CheckWarmupConvergence: Loads Initialization, Zone="'//TRIM(Zone(ZoneNum)%Name)// &
'" did not converge after '//TRIM(RoundSigDigits(MaxNumberOfWarmupDays))//' warmup days.')
IF (.not. WarmupConvergenceWarning .and. .not. DoingSizing) THEN
CALL ShowContinueError('See Warmup Convergence Information in .eio file for details.')
WarmupConvergenceWarning=.true.
ELSEIF (.not. SizingWarmupConvergenceWarning .and. DoingSizing) THEN
CALL ShowContinueError('Warmup Convergence failing during sizing.')
SizingWarmupConvergenceWarning=.true.
ENDIF
IF (RunPeriodEnvironment) THEN
CALL ShowContinueError('...Environment(RunPeriod)="'//TRIM(EnvironmentName)//'"')
ELSE
CALL ShowContinueError('...Environment(SizingPeriod)="'//TRIM(EnvironmentName)//'"')
ENDIF
CALL ShowContinueError('..Max Temp Comparison = '// &
TRIM(RoundSigDigits(WarmupConvergenceValues(ZoneNum)%TestMaxTempValue,2))// &
' vs Temperature Convergence Tolerance='//TRIM(RoundSigDigits(TempConvergTol,2))// &
' - '//PassFail(WarmupConvergenceValues(ZoneNum)%PassFlag(1))//' Convergence')
CALL ShowContinueError('..Min Temp Comparison = '// &
TRIM(RoundSigDigits(WarmupConvergenceValues(ZoneNum)%TestMinTempValue,2))// &
' vs Temperature Convergence Tolerance='//TRIM(RoundSigDigits(TempConvergTol,2))// &
' - '//PassFail(WarmupConvergenceValues(ZoneNum)%PassFlag(2))//' Convergence')
CALL ShowContinueError('..Max Heat Load Comparison = '// &
TRIM(RoundSigDigits(WarmupConvergenceValues(ZoneNum)%TestMaxHeatLoadValue,4))// &
' vs Loads Convergence Tolerance='//TRIM(RoundSigDigits(LoadsConvergTol,2))// &
' - '//PassFail(WarmupConvergenceValues(ZoneNum)%PassFlag(3))//' Convergence')
CALL ShowContinueError('..Max Cool Load Comparison = '// &
TRIM(RoundSigDigits(WarmupConvergenceValues(ZoneNum)%TestMaxCoolLoadValue,4))// &
' vs Loads Convergence Tolerance='//TRIM(RoundSigDigits(LoadsConvergTol,2))// &
' - '//PassFail(WarmupConvergenceValues(ZoneNum)%PassFlag(4))//' Convergence')
END IF
END IF
! Transfer current daily max and min loads and temperatures to the
! variables containing the last day's values
MaxHeatLoadPrevDay(ZoneNum)=MaxHeatLoadZone(ZoneNum)
MaxCoolLoadPrevDay(ZoneNum)=MaxCoolLoadZone(ZoneNum)
MaxTempPrevDay(ZoneNum)=MaxTempZone(ZoneNum)
MinTempPrevDay(ZoneNum)=MinTempZone(ZoneNum)
MaxHeatLoadZone(ZoneNum)=-9999.d0
MaxCoolLoadZone(ZoneNum)=-9999.d0
MaxTempZone(ZoneNum)=-9999.d0
MinTempZone(ZoneNum)=1000.d0
END DO
! Limit the number of warmup days, regardless of the number of zones
! in the building, to some arbitrary value based on common sense and
! experience with the (I)BLAST program. If too many warmup days were
! required, notify the program user.
IF ((DayOfSim >= MaxNumberOfWarmupDays) .and. WarmupFlag .and. ConvergenceChecksFailed) THEN
IF (MaxNumberOfWarmupDays < DefaultMaxNumberOfWarmupDays) THEN
CALL ShowSevereError('CheckWarmupConvergence: User supplied maximum warmup days='// &
TRIM(RoundSigDigits(MaxNumberOfWarmupDays))//' is insufficient.')
CALL ShowContinueError('Suggest setting maximum number of warmup days to at least '// &
trim(RoundSigDigits(DefaultMaxNumberOfWarmupDays))//'.')
ENDIF
ENDIF
! Set warmup flag to true depending on value of ConvergenceChecksFailed (true=fail)
! and minimum number of warmup days
IF (.not. ConvergenceChecksFailed .and. DayOfSim >= MinNumberOfWarmupDays) THEN
WarmupFlag=.false.
ELSEIF (.not. ConvergenceChecksFailed .and. DayOfSim < MinNumberOfWarmupDays) THEN
WarmupFlag=.true.
END IF
! If max warmup days reached and still warmupflag, then go to non-warmup state.
! prior messages will have been displayed
IF ((DayOfSim >= MaxNumberOfWarmupDays) .and. WarmupFlag) THEN
WarmupFlag=.false.
ENDIF
END IF
RETURN
END SUBROUTINE CheckWarmupConvergence