Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | ObjType | |||
character(len=*), | intent(in) | :: | ObjName |
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 GetObjectItemNum(ObjType,ObjName)
! SUBROUTINE INFORMATION
! AUTHOR: Fred Buhl
! DATE WRITTEN: Jan 1998
! MODIFIED: Lawrie, September 1999. Take advantage of internal
! InputProcessor structures to speed search.
! RE-ENGINEERED: This is new code, not reengineered
! PURPOSE OF THIS SUBROUTINE:
! Get the occurrence number of an object of type ObjType and name ObjName
! METHODOLOGY EMPLOYED:
! Use internal IDF record structure for each object occurrence
! and compare the name with ObjName.
! REFERENCES:
! na
IMPLICIT NONE
! SUBROUTINE ARGUMENTS:
CHARACTER(len=*), INTENT(IN) :: ObjType ! Object Type (ref: IDD Objects)
CHARACTER(len=*), INTENT(IN) :: ObjName ! Name of the object type
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK DEFINITIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DEFINITIONS
INTEGER :: NumObjOfType ! Total number of Object Type in IDF
INTEGER :: ObjNum ! Loop index variable
INTEGER :: ItemNum ! Item number for Object Name
INTEGER :: Found ! Indicator for Object Type in list of Valid Objects
CHARACTER(len=MaxObjectNameLength) :: UCObjType ! Upper Case for ObjType
LOGICAL :: ItemFound ! Set to true if item found
LOGICAL :: ObjectFound ! Set to true if object found
INTEGER :: StartRecord ! Start record for objects
ItemNum = 0
ItemFound=.false.
ObjectFound=.false.
UCObjType=MakeUPPERCase(ObjType)
IF (SortedIDD) THEN
Found=FindIteminSortedList(UCObjType,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(UCObjType,ListofObjects,NumObjectDefs)
ENDIF
IF (Found /= 0) THEN
ObjectFound=.true.
NumObjOfType=ObjectDef(Found)%NumFound
ItemNum=0
StartRecord=ObjectStartRecord(Found)
IF (StartRecord > 0) THEN
DO ObjNum=StartRecord,NumIDFRecords
IF (IDFRecords(ObjNum)%Name /= UCObjType) CYCLE
ItemNum=ItemNum+1
IF (ItemNum > NumObjOfType) EXIT
IF (IDFRecords(ObjNum)%Alphas(1) == ObjName) THEN
ItemFound=.true.
EXIT
ENDIF
END DO
ENDIF
ENDIF
IF (ObjectFound) THEN
IF (.not. ItemFound) ItemNum=0
ELSE
ItemNum=-1 ! if object not found, then flag it
ENDIF
GetObjectItemNum = ItemNum
RETURN
END FUNCTION GetObjectItemNum