Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ScheduleIndex | |||
character(len=*), | intent(in) | :: | MinString | |||
real(kind=r64), | intent(in) | :: | Minimum | |||
character(len=*), | intent(in) | :: | MaxString | |||
real(kind=r64), | 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 dCheckScheduleValueMinMax2(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(r64), INTENT(IN) :: Minimum ! Minimum desired value
CHARACTER(len=*), INTENT(IN) :: MaxString ! Maximum indicator ('<', ',=')
REAL(r64), 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
LOGICAL,SAVE :: RunOnceOnly = .TRUE.
!precompute the dayschedule max and min so that it is not in nested loop
IF (RunOnceOnly) THEN
DO Loop = 0,NumDaySchedules
DaySchedule(Loop)%TSValMin = MINVAL(DaySchedule(Loop)%TSValue)
DaySchedule(Loop)%TSValMax = MAXVAL(DaySchedule(Loop)%TSValue)
END DO
RunOnceOnly = .FALSE.
END IF
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=DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(1))%TSValMin
MaxValue=DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(1))%TSValMax
DO DayT=2,MaxDayTypes
MinValue=MIN(MinValue,DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValMin)
MaxValue=MAX(MaxValue,DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValMax)
ENDDO
DO Loop=2,366
WkSch=Schedule(ScheduleIndex)%WeekSchedulePointer(Loop)
DO DayT=1,MaxDayTypes
MinValue=MIN(MinValue,DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValMin)
MaxValue=MAX(MaxValue,DaySchedule(WeekSchedule(WkSch)%DaySchedulePointer(DayT))%TSValMax)
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
dCheckScheduleValueMinMax2=(MinValueOk .and. MaxValueOk)
RETURN
END FUNCTION dCheckScheduleValueMinMax2