Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ScheduleIndex | |||
real(kind=r64), | intent(in) | :: | Minimum | |||
character(len=*), | intent(in) | :: | MinString | |||
real(kind=r64), | intent(in), | optional | :: | Maximum | ||
character(len=*), | intent(in), | optional | :: | MaxString |
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 rCheckDayScheduleValueMinMax(ScheduleIndex,Minimum,MinString,Maximum,MaxString)
! 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 Day Schedule being tested
REAL(r64), INTENT(IN) :: Minimum ! Minimum desired value
CHARACTER(len=*), INTENT(IN) :: MinString ! Minimum indicator ('>', '>=')
REAL(r64), INTENT(IN), OPTIONAL :: Maximum ! Maximum desired value
CHARACTER(len=*), INTENT(IN), OPTIONAL :: MaxString ! Maximum indicator ('<', ',=')
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
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 > NumDaySchedules) THEN
CALL ShowFatalError('CheckDayScheduleValueMinMax called with ScheduleIndex out of range')
ENDIF
IF (ScheduleIndex > 0) THEN
MinValue=MINVAL(DaySchedule(ScheduleIndex)%TSValue)
MaxValue=MAXVAL(DaySchedule(ScheduleIndex)%TSValue)
ENDIF
! Min/max for schedule has been set. Test.
MinValueOk=.true.
MaxValueOk=.true.
IF (MinString == '>') THEN
MinValueOk=(MinValue > Minimum)
ELSE
MinValueOk=(MinValue >= Minimum)
ENDIF
IF (PRESENT(Maximum)) THEN
IF (PRESENT(MaxString)) THEN
IF (MaxString == '<') THEN
MaxValueOk=(MaxValue < Maximum)
ELSE
MaxValueOk=(MaxValue <= Maximum)
ENDIF
ELSE
MaxValueOk=(MaxValue <= Maximum)
ENDIF
ENDIF
rCheckDayScheduleValueMinMax=(MinValueOk .and. MaxValueOk)
RETURN
END FUNCTION rCheckDayScheduleValueMinMax