Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | TypeToVerify | |||
character(len=*), | intent(in) | :: | NameToVerify | |||
logical, | intent(out) | :: | ErrorFound | |||
character(len=*), | intent(in) | :: | StringToDisplay |
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 VerifyUniqueChillerName(TypeToVerify,NameToVerify,ErrorFound,StringToDisplay)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN October 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine verifys that a new name will be unique in the list of
! chillers. If not found in the list, it is added before returning.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: TypeToVerify
CHARACTER(len=*), INTENT(IN) :: NameToVerify
LOGICAL, INTENT(OUT) :: ErrorFound
CHARACTER(len=*), INTENT(IN) :: StringToDisplay
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER Found
TYPE (ComponentNameData), ALLOCATABLE, DIMENSION(:) :: TempChillerNames
ErrorFound=.false.
Found=0
IF (NumChillers > 0) &
Found=FindItemInList(NameToVerify,ChillerNames%CompName,NumChillers)
IF (Found /= 0) THEN
CALL ShowSevereError(TRIM(StringToDisplay)//', duplicate name='//TRIM(NameToVerify)// &
', Chiller Type="'//TRIM(ChillerNames(Found)%CompType)//'".')
CALL ShowContinueError('...Current entry is Chiller Type="'//trim(TypeToVerify)//'".')
ErrorFound=.true.
ELSEIF (NumChillers == 0) THEN
CurMaxChillers=4
ALLOCATE(ChillerNames(CurMaxChillers))
NumChillers=NumChillers+1
ChillerNames(NumChillers)%CompType=MakeUPPERCase(TypeToVerify)
ChillerNames(NumChillers)%CompName=NameToVerify
ELSEIF (NumChillers == CurMaxChillers) THEN
ALLOCATE(TempChillerNames(CurMaxChillers+4))
TempChillerNames(1:CurMaxChillers)=ChillerNames(1:CurMaxChillers)
DEALLOCATE(ChillerNames)
CurMaxChillers=CurMaxChillers+4
ALLOCATE(ChillerNames(CurMaxChillers))
ChillerNames=TempChillerNames
DEALLOCATE(TempChillerNames)
NumChillers=NumChillers+1
ChillerNames(NumChillers)%CompType=MakeUPPERCase(TypeToVerify)
ChillerNames(NumChillers)%CompName=NameToVerify
ELSE
NumChillers=NumChillers+1
ChillerNames(NumChillers)%CompType=MakeUPPERCase(TypeToVerify)
ChillerNames(NumChillers)%CompName=NameToVerify
ENDIF
RETURN
END SUBROUTINE VerifyUniqueChillerName