interface andIntervals subroutine andIntervalsBothScalar(intervalA, intervalB, andedIntervals) type(IntervalT), intent(in) :: intervalA, intervalB type(IntervalT), pointer :: andedIntervals(:) end subroutine andIntervalsBothScalar subroutine andIntervalsOneVector(intervalA, intervalsB, andedIntervals) type(IntervalT), intent(in) :: intervalA, intervalsB(:) type(IntervalT), pointer :: andedIntervals(:) end subroutine andIntervalsOneVector subroutine andIntervalsBothVector(intervalsA, intervalsB, andedIntervals) type(IntervalT), intent(in) :: intervalsA(:), intervalsB(:) type(IntervalT), pointer :: andedIntervals(:) end subroutine andIntervalsBothVector end interface
In all cases the intervals are first converted to RangeT structures as follows:
range%lower%type = INCLUSIVE range%upper%type = EXCLUSIVE range%lower%value = interval%lower range%upper%value = interval%upper
In this form, they can be ANDed together by use of the dss_aux call andRangesPair (see section 9.5.6)
NOTE! This function requires the intervals to be well-formed (see section 17.1).