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 VerifyUniqueBoilerName(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
! Boilers. 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(:) :: TempBoilerNames
ErrorFound=.false.
Found = 0
IF (NumBoilers > 0) &
Found=FindItemInList(NameToVerify,BoilerNames%CompName,NumBoilers)
IF (Found /= 0) THEN
CALL ShowSevereError(TRIM(StringToDisplay)//', duplicate name='//TRIM(NameToVerify)// &
', Boiler Type="'//TRIM(BoilerNames(Found)%CompType)//'".')
CALL ShowContinueError('...Current entry is Boiler Type="'//trim(TypeToVerify)//'".')
ErrorFound=.true.
ELSEIF (NumBoilers == 0) THEN
CurMaxBoilers=4
ALLOCATE(BoilerNames(CurMaxBoilers))
NumBoilers=NumBoilers+1
BoilerNames(NumBoilers)%CompType=TypeToVerify
BoilerNames(NumBoilers)%CompName=NameToVerify
ELSEIF (NumBoilers == CurMaxBoilers) THEN
ALLOCATE(TempBoilerNames(CurMaxBoilers+4))
TempBoilerNames(1:CurMaxBoilers)=BoilerNames(1:CurMaxBoilers)
DEALLOCATE(BoilerNames)
CurMaxBoilers=CurMaxBoilers+4
ALLOCATE(BoilerNames(CurMaxBoilers))
BoilerNames=TempBoilerNames
DEALLOCATE(TempBoilerNames)
NumBoilers=NumBoilers+1
BoilerNames(NumBoilers)%CompType=TypeToVerify
BoilerNames(NumBoilers)%CompName=NameToVerify
ELSE
NumBoilers=NumBoilers+1
BoilerNames(NumBoilers)%CompType=TypeToVerify
BoilerNames(NumBoilers)%CompName=NameToVerify
ENDIF
RETURN
END SUBROUTINE VerifyUniqueBoilerName