Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | String | |||
character(len=*), | intent(in), | DIMENSION(:) | :: | ListofItems | ||
integer, | intent(in) | :: | NumItems |
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.
INTEGER FUNCTION FindIteminSortedList(String,ListofItems,NumItems)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN September 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function looks up a string in a similar list of
! items and returns the index of the item in the list, if
! found. This routine is not case insensitive and doesn't need
! for most inputs -- they are automatically turned to UPPERCASE.
! If you need case insensitivity use FindItem.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: String
CHARACTER(len=*), INTENT(IN), DIMENSION(:) :: ListofItems
INTEGER, INTENT(IN) :: NumItems
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: LBnd
INTEGER :: UBnd
INTEGER :: Probe
LOGICAL :: Found
LBnd=0
UBnd=NumItems+1
Found=.false.
DO WHILE (.not. found .or. Probe /= 0)
Probe=(UBnd-LBnd)/2
IF (Probe == 0) EXIT
Probe=LBnd+Probe
IF (SameString(String,ListOfItems(Probe))) THEN
Found=.true.
EXIT
ELSEIF (MakeUPPERCase(String) < MakeUPPERCase(ListOfItems(Probe))) THEN
UBnd=Probe
ELSE
LBnd=Probe
ENDIF
ENDDO
FindIteminSortedList=Probe
RETURN
END FUNCTION FindIteminSortedList