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.
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 GetBranchListInput
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN July 2003
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine gets the branch list input and fills up the structures for
! branch lists.
! This subroutine gets the input for the following IDD structure:
! BRANCH LIST,
! \extensible:1 Just duplicate last field and \ comments (changing numbering, please)
! \memo Branches MUST be listed in flow order: inlet branch, then parallel branches, then outlet branch.
! \memo Branches are simulated in the order listed. Branch names cannot be duplicated within a single branch list.
! A1, \field Branch List Name
! \required-field
! \reference BranchLists
! A2, \field Branch Name 1
! \required-field
! \type object-list
! \object-list Branches
! A3, \field Branch Name 2
! \type object-list
! \object-list Branches
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetBranchListInput: '
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER Count ! Loop Counter
INTEGER BCount ! Actual Branch List Count
INTEGER Loop ! Loop Counter
INTEGER Found ! Points to correct Branch List/Branch
LOGICAL :: ErrFound ! True when error has occured (cannot find Branch List)
! Following are needed because routine calls GetBranchInput
! which would overwrite the module Alphas and NumAlphas
LOGICAL IsNotOK ! Flag for "VerifyName" routine
LOGICAL IsBlank ! Flag for "blank" name
INTEGER NumAlphas ! Used to retrieve Branch list from IDF
CHARACTER(len=MaxNameLength), ALLOCATABLE, &
DIMENSION(:):: Alphas ! Used to retrieve names from IDF
INTEGER NumNumbers
REAL(r64), ALLOCATABLE, DIMENSION(:) :: Numbers ! Not used in this object
CHARACTER(len=MaxNameLength+40),ALLOCATABLE, DIMENSION(:) :: cAlphaFields
CHARACTER(len=MaxNameLength+40),ALLOCATABLE, DIMENSION(:) :: cNumericFields
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lNumericBlanks
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lAlphaBlanks
INTEGER :: IOStat ! Could be used in the Get Routines, not currently checked
INTEGER :: NumParams
CHARACTER(len=MaxNameLength) :: TestName
ErrFound=.false.
CurrentModuleObject='BranchList'
NumOfBranchLists=GetNumObjectsFound(CurrentModuleObject)
ALLOCATE(BranchList(NumOfBranchLists))
BranchList%LoopName=Blank
BranchList%LoopType=Blank
CALL GetObjectDefMaxArgs(CurrentModuleObject,NumParams,NumAlphas,NumNumbers)
ALLOCATE(Alphas(NumAlphas))
Alphas=' '
ALLOCATE(Numbers(NumNumbers))
Numbers=0.0d0
ALLOCATE(cAlphaFields(NumAlphas))
cAlphaFields=' '
ALLOCATE(cNumericFields(NumNumbers))
cNumericFields=' '
ALLOCATE(lAlphaBlanks(NumAlphas))
lAlphaBlanks=.true.
ALLOCATE(lNumericBlanks(NumNumbers))
lNumericBlanks=.true.
IF (NumNumbers > 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)// &
' Object definition contains numbers, cannot be decoded by GetBranchListInput routine.')
ErrFound=.true.
ENDIF
BCount=0
DO Count=1,NumOfBranchLists
CALL GetObjectItem(CurrentModuleObject,Count,Alphas,NumAlphas,Numbers,NumNumbers,IOStat, &
AlphaBlank=lAlphaBlanks,NumBlank=lNumericBlanks, &
AlphaFieldnames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),BranchList%Name,BCount,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrFound=.true.
CYCLE
ENDIF
BCount=BCount+1
BranchList(BCount)%Name=Alphas(1)
BranchList(BCount)%NumOfBranchNames=NumAlphas-1
ALLOCATE(BranchList(BCount)%BranchNames(NumAlphas-1))
IF (BranchList(BCount)%NumOfBranchNames == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(BranchList(BCount)%Name)// &
'", No branch names entered.')
ErrFound=.true.
ELSE
BranchList(BCount)%BranchNames(1:NumAlphas-1)=Alphas(2:NumAlphas)
DO Loop=1,BranchList(BCount)%NumOfBranchNames
! If NumOfBranches = 0 then Branches havent been read yet.
IF (NumOfBranches == 0) THEN
CALL GetBranchInput
ENDIF
IF (BranchList(BCount)%BranchNames(Loop) /= Blank) THEN
Found=FindItemInList(BranchList(BCount)%BranchNames(Loop),Branch%Name,NumOfBranches)
IF (Found == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(BranchList(BCount)%Name)// &
'", invalid data.')
CALL ShowContinueError('..invalid Branch Name not found="'// &
TRIM(BranchList(BCount)%BranchNames(Loop))//'".')
ErrFound=.true.
ENDIF
ENDIF
ENDDO
ENDIF
ENDDO
! Check for duplicate names specified in Branch Lists
DO Count=1,NumOfBranchLists
IF (BranchList(Count)%NumOfBranchNames == 0) CYCLE
TestName=BranchList(Count)%BranchNames(1)
DO Loop=2,BranchList(Count)%NumOfBranchNames
IF (TestName /= BranchList(Count)%BranchNames(Loop)) CYCLE
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(BranchList(BCount)%Name)// &
'", invalid data.')
CALL ShowContinueError('..invalid: duplicate branch name specified in the list.')
CALL ShowContinueError('..Branch Name='//TRIM(TestName))
CALL ShowContinueError('..Branch Name #'//TRIM(TrimSigDigits(Loop))// &
' is duplicate.')
ErrFound=.true.
ENDDO
ENDDO
IF (ErrFound) THEN
CALL ShowSevereError(RoutineName//' Invalid Input -- preceding condition(s) will likely cause termination.')
ENDIF
NumOfBranchLists=BCount
DEALLOCATE(Alphas)
DEALLOCATE(Numbers)
DEALLOCATE(cAlphaFields)
DEALLOCATE(cNumericFields)
DEALLOCATE(lAlphaBlanks)
DEALLOCATE(lNumericBlanks)
RETURN
END SUBROUTINE GetBranchListInput