Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ScheduleIndex | |||
character(len=*), | intent(in) | :: | MinString | |||
real(kind=r32), | intent(in) | :: | Minimum | |||
character(len=*), | intent(in) | :: | MaxString | |||
real(kind=r32), | intent(in) | :: | Maximum |
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.
LOGICAL FUNCTION rCheckScheduleValueMinMax2(ScheduleIndex,MinString,Minimum,MaxString,Maximum)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN February 2003
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function checks the indicated schedule values for validity. Uses the ScheduleIndex
! from (GetScheduleIndex), a minimum and a maximum -- one or other optional to check "internals".
! METHODOLOGY EMPLOYED:
! Schedule data structure stores this on first validity check. If there, then is returned else
! looks up minimum and maximum values for the schedule and then sets result of function based on
! requested minimum/maximum checks.
! 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
CHARACTER(len=*), INTENT(IN) :: MinString ! Minimum indicator ('>', '>=')
REAL(r32), INTENT(IN) :: Minimum ! Minimum desired value
CHARACTER(len=*), INTENT(IN) :: MaxString ! Maximum indicator ('<', ',=')
REAL(r32), INTENT(IN) :: Maximum ! Maximum desired value
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER Loop ! Loop Control variable
INTEGER DayT ! Day Type Loop control
INTEGER WkSch ! Pointer for WeekSchedule value
REAL(r64) MinValue ! For total minimum
REAL(r64) Maxvalue ! For total maximum
LOGICAL :: MinValueOk
LOGICAL :: MaxValueOk
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('CheckScheduleValueMinMax 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
ENDIF
! Min/max for schedule has been set. Test.
MinValueOk=.true.
MaxValueOk=.true.
IF (MinString == '>') THEN
MinValueOk=(Schedule(ScheduleIndex)%MinValue > Minimum)
ELSE
MinValueOk=(Schedule(ScheduleIndex)%MinValue >= Minimum)
ENDIF
MaxValueOk=(Schedule(ScheduleIndex)%MaxValue <= Maximum)
IF (MaxString == '<') THEN
MaxValueOk=(Schedule(ScheduleIndex)%MaxValue < Maximum)
ELSE
MaxValueOk=(Schedule(ScheduleIndex)%MaxValue <= Maximum)
ENDIF
rCheckScheduleValueMinMax2=(MinValueOk .and. MaxValueOk)
RETURN
END FUNCTION rCheckScheduleValueMinMax2