Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(RootFinderDataType), | intent(in) | :: | RootFinderData |
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 CheckBracketRoundOff( RootFinderData )
! FUNCTION INFORMATION:
! AUTHOR Dimitri Curtil (LBNL)
! DATE WRITTEN February 2006
! MODIFIED
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function checks whether the current lower and upper brackets satisfies
! the round-off criterion or not.
!
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
TYPE(RootFinderDataType), INTENT(IN) :: RootFinderData ! Data used by root finding algorithm
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: DeltaUL ! Distance between lower and upper points
REAL(r64) :: TypUL ! Typical value for values lying within lower/upper interval
REAL(r64) :: TolUL ! Tolerance to satisfy for lower-upper distance
! FLOW:
! Check for round-off error in Lower/Upper interval
IF ( RootFinderData%LowerPoint%DefinedFlag .AND. RootFinderData%UpperPoint%DefinedFlag ) THEN
DeltaUL = RootFinderData%UpperPoint%X - RootFinderData%LowerPoint%X
TypUL = (ABS(RootFinderData%UpperPoint%X) + ABS(RootFinderData%LowerPoint%X))/2.0d0
TolUL = RootFinderData%Controls%TolX * ABS(TypUL) + RootFinderData%Controls%ATolX
! Halve tolerance to reflect the fact that solution can be anywhere between the lower and upper points.
IF ( ABS(DeltaUL) <= 0.5d0 * ABS(TolUL) ) THEN
CheckBracketRoundOff = .TRUE.
RETURN
END IF
END IF
CheckBracketRoundOff = .FALSE.
RETURN
END FUNCTION CheckBracketRoundOff