Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ScheduleIndex |
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.
FUNCTION GetScheduleMaxValue(ScheduleIndex) RESULT(MaximumValue)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN February 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function returns the maximum value used by a schedule over
! the entire year.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ScheduleIndex ! Which Schedule being tested
REAL(r64) :: MaximumValue ! Maximum value for schedule
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) MinValue
REAL(r64) MaxValue
INTEGER WkSch
INTEGER DayT
INTEGER Loop
IF (ScheduleIndex == -1) THEN
MinValue = 1.0d0
MaxValue = 1.0d0
ELSEIF (ScheduleIndex == 0) THEN
MinValue = 0.0d0
MaxValue = 0.0d0
ELSEIF (ScheduleIndex < 1 .or. ScheduleIndex > NumSchedules) THEN
CALL ShowFatalError('CheckScheduleMaxValue called with ScheduleIndex out of range')
ENDIF
IF (ScheduleIndex > 0) THEN
IF (.not. Schedule(ScheduleIndex)%MaxMinSet) THEN ! Set Minimum/Maximums for this schedule
WkSch=Schedule(ScheduleIndex)%WeekSchedulePointer(1)
MinValue=MINVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(1))%TSValue)
MaxValue=MAXVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(1))%TSValue)
DO DayT=2,MaxDayTypes
MinValue=MIN(MinValue,MINVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValue))
MaxValue=MAX(MaxValue,MAXVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValue))
ENDDO
DO Loop=2,366
WkSch=Schedule(ScheduleIndex)%WeekSchedulePointer(Loop)
DO DayT=1,MaxDayTypes
MinValue=MIN(MinValue,MINVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValue))
MaxValue=MAX(MaxValue,MAXVAL(DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValue))
ENDDO
ENDDO
Schedule(ScheduleIndex)%MaxMinSet=.true.
Schedule(ScheduleIndex)%MinValue=MinValue
Schedule(ScheduleIndex)%MaxValue=MaxValue
ENDIF
! Min/max for schedule has been set.
MaximumValue=Schedule(ScheduleIndex)%MaxValue
ELSE
MaximumValue=MaxValue
ENDIF
RETURN
END FUNCTION GetScheduleMaxValue