Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | WhichNumber | |||
integer, | intent(in), | DIMENSION(*) | :: | ListofItems | ||
integer, | intent(in) | :: | NumItems | |||
integer | :: | CountOfItems | ||||
integer, | ALLOCATABLE, DIMENSION(:) | :: | AllNumbersInList |
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.
SUBROUTINE FindAllNumbersinList(WhichNumber,ListofItems,NumItems, CountOfItems, AllNumbersInList)
! FUNCTION INFORMATION:
! AUTHOR R. Raustad
! DATE WRITTEN January 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function looks up a number(integer) in a similar list of
! items and returns the index of the item in the list, if
! found.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WhichNumber
INTEGER, 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 Count ! Counter for DO loops
INTEGER CountOfItems ! Number of items found
INTEGER, ALLOCATABLE, DIMENSION(:) :: AllNumbersInList ! Index array to all numbers found
CountOfItems = 0
IF (ALLOCATED(AllNumbersInList)) DEALLOCATE(AllNumbersInList)
DO Count=1,NumItems
IF (WhichNumber == ListofItems(Count)) THEN
CountOfItems=CountOfItems+1
ENDIF
END DO
IF(CountOfItems .GT. 0)THEN
ALLOCATE(AllNumbersInList(CountOfItems))
AllNumbersinList = 0
CountOfItems = 0
DO Count=1,NumItems
IF (WhichNumber == ListofItems(Count)) THEN
CountOfItems = CountOfItems + 1
AllNumbersInList(CountOfItems)=Count
ENDIF
END DO
END IF
RETURN
END SUBROUTINE FindAllNumbersinList