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 | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | mustprint | |||
character(len=*), | intent(in), | optional | :: | CompType | ||
character(len=*), | intent(in), | optional | :: | CompName |
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 AuditBranches(mustprint,CompType,CompName)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN November 2011
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine will point out any "dangling branches" that are not included on a BranchList.
! Warnings are produced as the user might clutter up the input file with unused branches.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits
USE DataErrorTracking, ONLY: TotalSevereErrors
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(IN) :: mustprint ! true if the warning should be printed.
CHARACTER(len=*), INTENT(IN), OPTIONAL :: CompType ! when mustprint (ScanPlantLoop) use CompType in error message and scan
CHARACTER(len=*), INTENT(IN), OPTIONAL :: CompName ! when mustprint (ScanPlantLoop) use CompName in error message and scan
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumDanglingCount ! when mustprint not true, count and report
INTEGER :: BlNum ! Branch List Counter
INTEGER :: BrN ! Branch Counter
INTEGER :: CpN ! Components on Branch
INTEGER :: Found ! non-zero when found
CHARACTER(len=MaxNameLength) :: FoundBranchName ! Branch matching compname/type
LOGICAL :: NeverFound
NumDanglingCount=0
NeverFound=.true.
DO BrN=1,NumOfBranches
Found=0
FoundBranchName=' '
IF (PRESENT(CompType) .and. PRESENT(CompName)) THEN
DO CpN=1,Branch(BrN)%NumOfComponents
IF (.not. SameString(CompType,Branch(BrN)%Component(CpN)%CType) .or. &
.not. SameString(CompName,Branch(BrN)%Component(CpN)%Name) ) CYCLE
FoundBranchName=Branch(BrN)%Name
NeverFound=.false.
ENDDO
ENDIF
DO BlNum=1,NumOfBranchLists
Found=FindItemInList(Branch(BrN)%Name,BranchList(BlNum)%BranchNames,BranchList(BlNum)%NumOfBranchNames)
IF (Found /= 0) EXIT
ENDDO
IF (Found /= 0) CYCLE
NumDanglingCount=NumDanglingCount+1
IF (DisplayExtraWarnings .or. mustprint) THEN
IF (mustprint) THEN
CALL ShowContinueError('AuditBranches: Branch="'//trim(Branch(BrN)%Name)//'" not found on any BranchLists.')
IF (FoundBranchName /= ' ') THEN
CALL ShowContinueError('Branch contains component, type="'//trim(CompType)//'", name="'// &
trim(CompName)//'"')
ENDIF
ELSE
CALL ShowSevereMessage('AuditBranches: Branch="'//trim(Branch(BrN)%Name)//'" not found on any BranchLists.')
TotalSevereErrors=TotalSevereErrors+1
ENDIF
ENDIF
ENDDO
IF (mustprint .and. NeverFound) THEN ! this may be caught during branch input, not sure
CALL ShowContinueError('Component, type="'//trim(CompType)//'", name="'//trim(CompName)//'" was not found on any Branch.')
CALL ShowContinueError('Look for mistyped branch or component names/types.')
ENDIF
IF (.not. mustprint .and. NumDanglingCount > 0) THEN
CALL ShowSevereMessage('AuditBranches: There are '//trim(RoundSigDigits(NumDanglingCount))// &
' branch(es) that do not appear on any BranchList.')
TotalSevereErrors=TotalSevereErrors+NumDanglingCount
CALL ShowContinueError('Use Output:Diagnostics,DisplayExtraWarnings; for detail of each branch not on a branch list.')
ENDIF
RETURN
END SUBROUTINE AuditBranches