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) | :: | CompName | |||
character(len=*), | intent(in) | :: | CompType | |||
character(len=*), | intent(in) | :: | TankName | |||
logical, | intent(inout) | :: | ErrorsFound | |||
integer, | intent(out) | :: | TankIndex | |||
integer, | intent(out) | :: | WaterSupplyIndex |
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 InternalSetupTankSupplyComponent(CompName, CompType, TankName, ErrorsFound, TankIndex, WaterSupplyIndex)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN August 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Each simulated component that can supply water to a tank
! makes one call to this subroutine to obtain the data
! array index it should use to set values in the
! VdotAvailSupply
! METHODOLOGY EMPLOYED:
! push the VdotAvailToTank array and return
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor , only: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(Len=*), INTENT(IN) :: CompName
CHARACTER(Len=*), INTENT(IN) :: CompType
CHARACTER(Len=*), INTENT(IN) :: TankName
LOGICAL ,INTENT(INOUT) :: ErrorsFound
INTEGER , INTENT(OUT) :: TankIndex
INTEGER , INTENT(OUT) :: WaterSupplyIndex
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: oldNumSupply
CHARACTER(Len=MaxNameLength), Allocatable :: oldSupplyCompNames(:)
CHARACTER(Len=MaxNameLength), Allocatable :: oldSupplyCompTypes(:)
! LOGICAL , SAVE :: MyOneTimeFlag = .true.
TankIndex = FindItemInList(TankName, WaterStorage%Name, NumWaterStorageTanks)
If (TankIndex == 0) Then
Call ShowSevereError('WaterUse:Storage (Water Storage Tank) ="'//trim(TankName)//'" not found in ' &
//trim(CompType)//' called '//trim(CompName) )
errorsFound = .true.
RETURN ! So we don't pass TankIndex=0
ENDIF
oldNumSupply = WaterStorage(TankIndex)%NumWaterSupplies
If (oldNumSupply > 0) Then ! do array push
IF( ALLOCATED(oldSupplyCompNames)) DEALLOCATE(oldSupplyCompNames)
Allocate(oldSupplyCompNames(oldNumSupply))
IF( ALLOCATED(oldSupplyCompTypes)) DEALLOCATE(oldSupplyCompTypes)
ALLOCATE(oldSupplyCompTypes(oldNumSupply))
If (ALLOCATED(WaterStorage(TankIndex)%SupplyCompNames)) THEN
oldSupplyCompNames = WaterStorage(TankIndex)%SupplyCompNames
DEALLOCATE(WaterStorage(TankIndex)%SupplyCompNames)
ALLOCATE(WaterStorage(TankIndex)%SupplyCompNames(oldNumSupply + 1))
WaterStorage(TankIndex)%SupplyCompNames(1:oldNumSupply) = oldSupplyCompNames !array assignment
WaterStorage(TankIndex)%SupplyCompNames(oldNumSupply + 1) = CompName
ENDIF
If (ALLOCATED(WaterStorage(TankIndex)%SupplyCompTypes)) THEN
oldSupplyCompTypes = WaterStorage(TankIndex)%SupplyCompTypes
DEALLOCATE(WaterStorage(TankIndex)%SupplyCompTypes)
ALLOCATE(WaterStorage(TankIndex)%SupplyCompTypes(oldNumSupply + 1))
WaterStorage(TankIndex)%SupplyCompTypes(1:oldNumSupply) = oldSupplyCompTypes !array assignment
WaterStorage(TankIndex)%SupplyCompTypes(oldNumSupply + 1) = CompType
ENDIF
DEALLOCATE(WaterStorage(TankIndex)%VdotAvailSupply)
ALLOCATE(WaterStorage(TankIndex)%VdotAvailSupply(oldNumSupply + 1))
WaterStorage(TankIndex)%VdotAvailSupply = 0.0d0 !initialize
DEALLOCATE(WaterStorage(TankIndex)%TwaterSupply)
ALLOCATE(WaterStorage(TankIndex)%TwaterSupply(oldNumSupply + 1))
WaterStorage(TankIndex)%TwaterSupply = 0.0d0 !initialize
WaterSupplyIndex = oldNumSupply + 1
WaterStorage(TankIndex)%NumWaterSupplies = WaterStorage(TankIndex)%NumWaterSupplies + 1
ELSE ! first time (no push)
ALLOCATE(WaterStorage(TankIndex)%VdotAvailSupply(1))
WaterStorage(TankIndex)%VdotAvailSupply = 0.0d0 !initialize
ALLOCATE(WaterStorage(TankIndex)%TwaterSupply(1))
WaterStorage(TankIndex)%TwaterSupply = 0.0d0 !initialize
ALLOCATE(WaterStorage(TankIndex)%SupplyCompNames(1))
WaterStorage(TankIndex)%SupplyCompNames(1) = CompName
ALLOCATE(WaterStorage(TankIndex)%SupplyCompTypes(1))
WaterStorage(TankIndex)%SupplyCompTypes(1) = CompType
WaterSupplyIndex = 1
WaterStorage(TankIndex)%NumWaterSupplies = 1
ENDIF
RETURN
END SUBROUTINE InternalSetupTankSupplyComponent