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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | NodeNumber | |||
character(len=*), | intent(in) | :: | NodeName | |||
character(len=*), | intent(in) | :: | ObjectType | |||
character(len=*), | intent(in) | :: | ObjectName | |||
character(len=*), | intent(in) | :: | ConnectionType | |||
integer, | intent(in) | :: | FluidStream | |||
logical, | intent(in) | :: | IsParent | |||
logical, | intent(inout) | :: | errFlag | |||
character(len=*), | intent(in), | optional | :: | InputFieldName |
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.
SUBROUTINE RegisterNodeConnection(NodeNumber,NodeName,ObjectType,ObjectName,ConnectionType,FluidStream,IsParent, &
errFlag,InputFieldName)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN February 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine registers a node connection in the Node Connection data structure. This
! structure is intended to help with HVAC diagramming as well as validation of nodes.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: SameString, MakeUPPERCase, FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: NodeNumber ! Number for this Node
CHARACTER(len=*), INTENT(IN) :: NodeName ! Name of this Node
CHARACTER(len=*), INTENT(IN) :: ObjectType ! Type of object this Node is connected to (e.g. Chiller:Electric)
CHARACTER(len=*), INTENT(IN) :: ObjectName ! Name of object this Node is connected to (e.g. MyChiller)
CHARACTER(len=*), INTENT(IN) :: ConnectionType ! Connection Type for this Node (must be valid)
INTEGER, INTENT(IN) :: FluidStream ! Count on Fluid Streams
LOGICAL, INTENT(IN) :: IsParent ! True when node is a parent node
LOGICAL, INTENT(INOUT) :: errFlag ! Will be True if errors already detected or if errors found here
CHARACTER(len=*), INTENT(IN),OPTIONAL :: InputFieldName ! Input Field Name
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='RegisterNodeConnection: '
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL ErrorsFoundHere
INTEGER Count
LOGICAL MakeNew
INTEGER Found
ErrorsFoundHere=.false.
IF (.not. IsValidConnectionType(ConnectionType)) THEN
CALL ShowSevereError(RoutineName//'Invalid ConnectionType='//TRIM(ConnectionType))
CALL ShowContinueError('Occurs for Node='//TRIM(NodeName)//', ObjectType='//TRIM(ObjectType)// &
', ObjectName='//TRIM(ObjectName))
ErrorsFoundHere=.true.
ENDIF
MakeNew=.true.
DO Count=1,NumOfNodeConnections
IF (NodeConnections(Count)%NodeNumber /= NodeNumber) CYCLE
IF (.not. SameString(NodeConnections(Count)%ObjectType,ObjectType)) CYCLE
IF (.not. SameString(NodeConnections(Count)%ObjectName,ObjectName)) CYCLE
IF (.not. SameString(NodeConnections(Count)%ConnectionType,ConnectionType)) CYCLE
IF (NodeConnections(Count)%FluidStream /= FluidStream) CYCLE
IF ( (NodeConnections(Count)%ObjectIsParent .and. .not. IsParent) .or. &
(.not. NodeConnections(Count)%ObjectIsParent .and. IsParent) ) THEN
CALL ShowSevereError(RoutineName//'Node registered for both Parent and "not" Parent')
CALL ShowContinueError('Occurs for Node='//TRIM(NodeName)//', ObjectType='//TRIM(ObjectType)// &
', ObjectName='//TRIM(ObjectName))
ErrorsFoundHere=.true.
ENDIF
MakeNew=.false.
ENDDO
IF (MakeNew) THEN
NumOfNodeConnections=NumOfNodeConnections+1
IF (NumOfNodeConnections > 1 .and. NumOfNodeConnections > MaxNumOfNodeConnections) THEN
ALLOCATE(TmpNodeConnections(MaxNumOfNodeConnections+NodeConnectionAlloc))
TmpNodeConnections(1:NumOfNodeConnections-1)=NodeConnections(1:NumOfNodeConnections-1)
DEALLOCATE(NodeConnections)
ALLOCATE(NodeConnections(MaxNumOfNodeConnections+NodeConnectionAlloc))
NodeConnections(1:NumOfNodeConnections-1)=TmpNodeConnections(1:NumOfNodeConnections-1)
DEALLOCATE(TmpNodeConnections)
MaxNumOfNodeConnections=MaxNumOfNodeConnections+NodeConnectionAlloc
ELSEIF (NumOfNodeConnections == 1) THEN
ALLOCATE(NodeConnections(NodeConnectionAlloc))
MaxNumOfNodeConnections=NodeConnectionAlloc
ENDIF
NodeConnections(NumOfNodeConnections)%NodeNumber=NodeNumber
NodeConnections(NumOfNodeConnections)%NodeName=NodeName
NodeConnections(NumOfNodeConnections)%ObjectType=MakeUPPERCase(ObjectType)
NodeConnections(NumOfNodeConnections)%ObjectName=ObjectName
NodeConnections(NumOfNodeConnections)%ConnectionType=ConnectionType
NodeConnections(NumOfNodeConnections)%FluidStream=FluidStream
NodeConnections(NumOfNodeConnections)%ObjectIsParent=IsParent
ENDIF
IF (SameString(ObjectType(1:MIN(len_Trim(ObjectType),12)),'AirTerminal:')) THEN
IF (PRESENT(InputFieldName)) THEN
NumOfAirTerminalNodes=NumOfAirTerminalNodes+1
IF (NumOfAirTerminalNodes > 1 .and. NumOfAirTerminalNodes > MaxNumOfAirTerminalNodes) THEN
ALLOCATE(tmpEqNodeConnections(MaxNumOfAirTerminalNodes))
tmpEqNodeConnections(1:NumOfAirTerminalNodes-1)=AirTerminalNodeConnections(1:NumOfAirTerminalNodes-1)
DEALLOCATE(AirTerminalNodeConnections)
ALLOCATE(AirTerminalNodeConnections(MaxNumOfAirTerminalNodes+EqNodeConnectionAlloc))
AirTerminalNodeConnections(1:NumOfAirTerminalNodes-1)=tmpEqNodeConnections(1:NumOfAirTerminalNodes-1)
DEALLOCATE(tmpEqNodeConnections)
MaxNumOfAirTerminalNodes=MaxNumOfAirTerminalNodes+EqNodeConnectionAlloc
ELSEIF (NumOfAirTerminalNodes == 1) THEN
ALLOCATE(AirTerminalNodeConnections(EqNodeConnectionAlloc))
MaxNumOfAirTerminalNodes=EqNodeConnectionAlloc
ENDIF
! Check out AirTerminal inlet/outlet nodes
Found=FindItemInList(NodeName,AirTerminalNodeConnections%NodeName,NumOfAirTerminalNodes-1)
IF (Found /= 0) THEN ! Nodename already used
CALL ShowSevereError(RoutineName//trim(ObjectType)//'="'//trim(ObjectName)//'" node name duplicated.')
CALL ShowContinueError('NodeName="'//trim(NodeName)//'", entered as type='//trim(ConnectionType))
CALL ShowContinueError('In Field='//trim(InputFieldName))
CALL ShowContinueError('Already used in '//trim(AirTerminalNodeConnections(Found)%ObjectType)//'="'// &
trim(AirTerminalNodeConnections(Found)%ObjectName)//'".')
CALL ShowContinueError(' as type='//trim(AirTerminalNodeConnections(Found)%ConnectionType)// &
', In Field='//trim(AirTerminalNodeConnections(Found)%InputFieldName))
ErrorsFoundHere=.true.
ELSE
AirTerminalNodeConnections(NumOfAirTerminalNodes)%NodeName=NodeName
AirTerminalNodeConnections(NumOfAirTerminalNodes)%ObjectType=ObjectType
AirTerminalNodeConnections(NumOfAirTerminalNodes)%ObjectName=ObjectName
AirTerminalNodeConnections(NumOfAirTerminalNodes)%ConnectionType=ConnectionType
AirTerminalNodeConnections(NumOfAirTerminalNodes)%InputFieldName=InputFieldName
ENDIF
ELSE
CALL ShowSevereError(RoutineName//trim(ObjectType)//', Developer Error: Input Field Name not included.')
CALL ShowContinueError('Node names not checked for duplication.')
ENDIF
ENDIF
IF (ErrorsFoundHere) THEN
errFlag=.true.
ENDIF
RETURN
END SUBROUTINE RegisterNodeConnection