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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | ResourceName | |||
character(len=*), | intent(in) | :: | EndUseName | |||
character(len=*), | intent(in) | :: | EndUseSubName |
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 AddEndUseSubcategory(ResourceName, EndUseName, EndUseSubName)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN February 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages the list of subcategories for each end-use category.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataInterfaces, ONLY: ShowSevereError
USE InputProcessor, ONLY: SameString
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: ResourceName
CHARACTER(len=*), INTENT(IN) :: EndUseName
CHARACTER(len=*), INTENT(IN) :: EndUseSubName
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: Found
INTEGER :: EndUseNum
INTEGER :: EndUseSubNum
INTEGER :: NumSubs
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: SubcategoryNameTemp
Found = .FALSE.
DO EndUseNum = 1, NumEndUses
IF (SameString(EndUseCategory(EndUseNum)%Name, EndUseName)) THEN
DO EndUseSubNum = 1, EndUseCategory(EndUseNum)%NumSubcategories
IF (SameString(EndUseCategory(EndUseNum)%SubcategoryName(EndUseSubNum), EndUseSubName)) THEN
! Subcategory already exists, no further action required
Found = .TRUE.
EXIT
END IF
END DO
IF (.NOT. Found) THEN
! Add the subcategory by reallocating the array
NumSubs = EndUseCategory(EndUseNum)%NumSubcategories
IF (NumSubs > 0) THEN
ALLOCATE(SubcategoryNameTemp(NumSubs))
SubcategoryNameTemp = EndUseCategory(EndUseNum)%SubcategoryName
DEALLOCATE(EndUseCategory(EndUseNum)%SubcategoryName)
END IF
ALLOCATE(EndUseCategory(EndUseNum)%SubcategoryName(NumSubs + 1))
IF (NumSubs > 0) THEN
EndUseCategory(EndUseNum)%SubcategoryName(1:NumSubs) = SubcategoryNameTemp(1:NumSubs)
DEALLOCATE(SubcategoryNameTemp)
END IF
EndUseCategory(EndUseNum)%NumSubcategories = NumSubs + 1
EndUseCategory(EndUseNum)%SubcategoryName(NumSubs + 1) = EndUseSubName
IF (EndUseCategory(EndUseNum)%NumSubcategories > MaxNumSubcategories) THEN
MaxNumSubcategories = EndUseCategory(EndUseNum)%NumSubcategories
END IF
Found = .TRUE.
END IF
EXIT
END IF
END DO
IF (.NOT. Found) THEN
CALL ShowSevereError('Nonexistent end use passed to AddEndUseSubcategory='//TRIM(EndUseName))
END IF
RETURN
END SUBROUTINE AddEndUseSubcategory