Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | CompType | |||
character(len=*), | intent(in) | :: | CompName | |||
character(len=*), | intent(in) | :: | InletNode | |||
character(len=*), | intent(in) | :: | OutletNode | |||
character(len=*), | intent(in) | :: | Description |
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 TestCompSet(CompType,CompName,InletNode,OutletNode,Description)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN November 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Register a child component in the CompSets data structure.
!
! NOTE: This function was originally designed to test the stored "Component Sets" to
! see if there was one of this combination in there. Thus the name "TestCompSet".
! However, this was based on a false assumption that input would always be gotten
! first for the parent object, then for the child object. But this is often not the
! case. Ultimately, the name of this function should be changed or it should be merged
! into SetUpCompSets.
!
! Until then, this function does the following:
! a) Search CompSets for this combination of component type, component name,
! inlet node and outlet node. If component type/name match and the existing
! node names are UNDEFINED, this compset is assumed to be a match.
!
! b) If found, fill in any missing data such as node names or node description
!
! c) If not found, call SetUpCompSets (with parent type and name UNDEFINED)
! to add a new item in the CompSets array
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: MakeUPPERCase
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: CompType ! Component Type
CHARACTER(len=*), INTENT(IN) :: CompName ! Component Name
CHARACTER(len=*), INTENT(IN) :: InletNode ! Inlet Node Name
CHARACTER(len=*), INTENT(IN) :: OutletNode ! Outlet Node Name
CHARACTER(len=*), INTENT(IN) :: Description ! Description of Node Pair (for warning message)
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER Count
INTEGER Found
CHARACTER(len=MaxNameLength) :: CompTypeUC ! Component type in upper case
CompTypeUC = MakeUPPERCase(CompType)
! See if Already there
Found=0
DO Count=1,NumCompSets
IF ((CompTypeUC /= CompSets(Count)%CType) .and. (CompSets(Count)%CType /= 'UNDEFINED')) CYCLE
IF (CompName /= CompSets(Count)%CName) CYCLE
IF ((InletNode /= CompSets(Count)%InletNodeName) .and. (CompSets(Count)%InletNodeName /= 'UNDEFINED') &
.and. (InletNode /= 'UNDEFINED')) CYCLE
IF ((OutletNode /= CompSets(Count)%OutletNodeName) .and. (CompSets(Count)%OutletNodeName /= 'UNDEFINED') &
.and. (OutletNode /= 'UNDEFINED')) CYCLE
Found=Count
EXIT
ENDDO
IF (Found == 0) THEN
CALL SetUpCompSets('UNDEFINED','UNDEFINED',CompType,CompName,InletNode,OutletNode,Description)
ELSE
! Fill in node names and component type for previously undefined values:
! If the parent object did not specify a component type or inlet or outlet node, then that value
! is UNDEFINED in CompSets. When a component calls TestCompSet, the comp type and inlet and
! outlet nodes are known, so they can be filled in for future reference.
IF (CompSets(Found)%CType == 'UNDEFINED') CompSets(Found)%CType = CompTypeUC
IF (CompSets(Found)%InletNodeName == 'UNDEFINED') CompSets(Found)%InletNodeName = InletNode
IF (CompSets(Found)%OutletNodeName == 'UNDEFINED') CompSets(Found)%OutletNodeName = OutletNode
IF (CompSets(Found)%Description == 'UNDEFINED') CompSets(Found)%Description = Description
ENDIF
RETURN
END SUBROUTINE TestCompSet