36 '$Id: Search_Utility.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 104 REAL(fp),
DIMENSION(:),
INTENT(IN) :: x
105 REAL(fp),
INTENT(IN) :: u
106 INTEGER,
OPTIONAL,
INTENT(IN) :: xlower
107 INTEGER,
OPTIONAL,
INTENT(IN) :: xupper
121 IF (
PRESENT(xlower) )
THEN 127 IF (
PRESENT(xupper) )
THEN 135 bisection_search_loop:
DO 138 IF ( (jupper-jlower) <= 1 )
EXIT bisection_search_loop
141 jmiddle = ( jlower + jupper ) / 2
144 IF ( ( x(n) > x(1) ) .EQV. ( u > x(jmiddle) ) )
THEN 150 END DO bisection_search_loop
204 REAL(fp),
DIMENSION(:),
INTENT(IN) :: x
205 REAL(fp),
DIMENSION(:),
INTENT(IN) :: u
207 INTEGER,
DIMENSION(SIZE(u)) :: j
211 INTEGER :: xlower, xupper
219 IF ( x(nx) > x(1) .AND. u(nu) > u(1) )
THEN 221 ELSEIF ( x(nx) < x(1) .AND. u(nu) < u(1) )
THEN 229 IF ( ascending )
THEN 234 xlower =
max( 1, j(iu) )
241 xlower =
min( j(iu), nx )
integer, parameter, public failure
integer, parameter, public fp
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
character(*), parameter module_version_id
integer function, dimension(size(u)), public value_locate(x, u)
integer, parameter, public success
integer function, public bisection_search(x, u, xLower, xUpper)