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 VerifyUniqueCoilName(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
! Coils. 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(:) :: TempCoilNames
ErrorFound=.false.
Found=0
IF (NumCoils > 0) &
Found=FindItemInList(NameToVerify,CoilNames%CompName,NumCoils)
IF (Found /= 0) THEN
CALL ShowSevereError(TRIM(StringToDisplay)//', duplicate name='//TRIM(NameToVerify)// &
', Coil Type="'//TRIM(CoilNames(Found)%CompType)//'"')
CALL ShowContinueError('...Current entry is Coil Type="'//trim(TypeToVerify)//'".')
ErrorFound=.true.
ELSEIF (NumCoils == 0) THEN
CurMaxCoils=4
ALLOCATE(CoilNames(CurMaxCoils))
NumCoils=NumCoils+1
CoilNames(NumCoils)%CompType=MakeUPPERCase(TypeToVerify)
CoilNames(NumCoils)%CompName=NameToVerify
ELSEIF (NumCoils == CurMaxCoils) THEN
ALLOCATE(TempCoilNames(CurMaxCoils+4))
TempCoilNames(1:CurMaxCoils)=CoilNames(1:CurMaxCoils)
DEALLOCATE(CoilNames)
CurMaxCoils=CurMaxCoils+4
ALLOCATE(CoilNames(CurMaxCoils))
CoilNames=TempCoilNames
DEALLOCATE(TempCoilNames)
NumCoils=NumCoils+1
CoilNames(NumCoils)%CompType=MakeUPPERCase(TypeToVerify)
CoilNames(NumCoils)%CompName=NameToVerify
ELSE
NumCoils=NumCoils+1
CoilNames(NumCoils)%CompType=MakeUPPERCase(TypeToVerify)
CoilNames(NumCoils)%CompName=NameToVerify
ENDIF
RETURN
END SUBROUTINE VerifyUniqueCoilName