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) | :: | WaterDemandIndex |
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 InternalSetupTankDemandComponent(CompName, CompType, TankName, ErrorsFound, TankIndex, WaterDemandIndex)
! 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:
! na
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) :: WaterDemandIndex
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: oldNumDemand
CHARACTER(Len=MaxNameLength), Allocatable :: oldDemandCompNames(:)
CHARACTER(Len=MaxNameLength), Allocatable :: oldDemandCompTypes(:)
! 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
ENDIF
oldNumDemand = WaterStorage(TankIndex)%NumWaterDemands
If (oldNumDemand > 0) Then ! do array push
IF( ALLOCATED(oldDemandCompNames)) DEALLOCATE(oldDemandCompNames)
Allocate(oldDemandCompNames(oldNumDemand))
IF( ALLOCATED(oldDemandCompTypes)) DEALLOCATE(oldDemandCompTypes)
ALLOCATE(oldDemandCompTypes(oldNumDemand))
If (ALLOCATED(WaterStorage(TankIndex)%DemandCompNames)) THEN
oldDemandCompNames = WaterStorage(TankIndex)%DemandCompNames
DEALLOCATE(WaterStorage(TankIndex)%DemandCompNames)
ALLOCATE(WaterStorage(TankIndex)%DemandCompNames(oldNumDemand + 1))
WaterStorage(TankIndex)%DemandCompNames(1:oldNumDemand) = oldDemandCompNames !array assignment
WaterStorage(TankIndex)%DemandCompNames(oldNumDemand + 1) = CompName
ENDIF
If (ALLOCATED(WaterStorage(TankIndex)%DemandCompTypes)) THEN
oldDemandCompTypes = WaterStorage(TankIndex)%DemandCompTypes
DEALLOCATE(WaterStorage(TankIndex)%DemandCompTypes)
ALLOCATE(WaterStorage(TankIndex)%DemandCompTypes(oldNumDemand + 1))
WaterStorage(TankIndex)%DemandCompTypes(1:oldNumDemand) = oldDemandCompTypes !array assignment
WaterStorage(TankIndex)%DemandCompTypes(oldNumDemand + 1) = CompType
ENDIF
DEALLOCATE(WaterStorage(TankIndex)%VdotRequestDemand)
ALLOCATE(WaterStorage(TankIndex)%VdotRequestDemand(oldNumDemand + 1))
WaterStorage(TankIndex)%VdotRequestDemand = 0.0d0 !initialize
DEALLOCATE(WaterStorage(TankIndex)%VdotAvailDemand)
ALLOCATE(WaterStorage(TankIndex)%VdotAvailDemand(oldNumDemand + 1))
WaterStorage(TankIndex)%VdotAvailDemand = 0.0d0 !initialize
WaterDemandIndex = oldNumDemand + 1
WaterStorage(TankIndex)%NumWaterDemands = WaterStorage(TankIndex)%NumWaterDemands + 1
ELSE ! first time (no push)
ALLOCATE(WaterStorage(TankIndex)%VdotRequestDemand(1))
WaterStorage(TankIndex)%VdotRequestDemand = 0.0d0 !initialize
ALLOCATE(WaterStorage(TankIndex)%VdotAvailDemand(1))
WaterStorage(TankIndex)%VdotAvailDemand = 0.0d0 !initialize
ALLOCATE(WaterStorage(TankIndex)%DemandCompNames(1))
WaterStorage(TankIndex)%DemandCompNames(1) = CompName
ALLOCATE(WaterStorage(TankIndex)%DemandCompTypes(1))
WaterStorage(TankIndex)%DemandCompTypes(1) = CompType
WaterStorage(TankIndex)%NumWaterDemands = 1
WaterDemandIndex = 1
ENDIF
RETURN
END SUBROUTINE InternalSetupTankDemandComponent