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.
! Following if EndUse is by ResourceType
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | MtrUnits | |||
character(len=*), | intent(inout) | :: | ResourceType | |||
character(len=*), | intent(inout) | :: | EndUse | |||
character(len=*), | intent(inout) | :: | EndUseSub | |||
character(len=*), | intent(inout) | :: | Group | |||
character(len=*), | intent(in) | :: | ZoneName | |||
integer, | intent(in) | :: | RepVarNum | |||
integer, | intent(out) | :: | MeterArrayPtr | |||
logical, | intent(inout) | :: | ErrorsFound |
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 AttachMeters(MtrUnits,ResourceType,EndUse,EndUseSub,Group,ZoneName,RepVarNum,MeterArrayPtr,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN January 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine determines which meters this variable will be on (if any),
! sets up the meter pointer arrays, and returns a index value to this array which
! is stored with the variable.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItem, SameString
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: MtrUnits ! Units for this meter
CHARACTER(len=*), INTENT(INOUT) :: ResourceType ! Electricity, Gas, etc.
CHARACTER(len=*), INTENT(INOUT) :: EndUse ! End-use category (Lights, Heating, etc.)
CHARACTER(len=*), INTENT(INOUT) :: EndUseSub ! End-use subcategory (user-defined, e.g., General Lights, Task Lights, etc.)
CHARACTER(len=*), INTENT(INOUT) :: Group ! Group key (Facility, Zone, Building, etc.)
CHARACTER(len=*), INTENT(IN) :: ZoneName ! Zone key only applicable for Building group
INTEGER, INTENT(IN) :: RepVarNum ! Number of this report variable
INTEGER, INTENT(OUT) :: MeterArrayPtr ! Output set of Pointers to Meters
LOGICAL, INTENT(INOUT) :: ErrorsFound ! True if errors in this call
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE (MeterArrayType), DIMENSION(:), ALLOCATABLE :: TempMeterArrays
INTEGER Found
IF (SameString(Group,'Building')) THEN
CALL ValidateNStandardizeMeterTitles(MtrUnits,ResourceType,EndUse,EndUseSub,Group,ErrorsFound,ZoneName)
ELSE
CALL ValidateNStandardizeMeterTitles(MtrUnits,ResourceType,EndUse,EndUseSub,Group,ErrorsFound)
ENDIF
IF (NumVarMeterArrays > 0) THEN
ALLOCATE(TempMeterArrays(NumVarMeterArrays))
TempMeterArrays(1:NumVarMeterArrays)=VarMeterArrays
DEALLOCATE(VarMeterArrays)
ENDIF
ALLOCATE(VarMeterArrays(NumVarMeterArrays+1))
IF (NumVarMeterArrays >0) THEN
VarMeterArrays(1:NumVarMeterArrays)=TempMeterArrays
DEALLOCATE(TempMeterArrays)
ENDIF
NumVarMeterArrays=NumVarMeterArrays+1
MeterArrayPtr=NumVarMeterArrays
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=0
VarMeterArrays(NumVarMeterArrays)%RepVariable=RepVarNum
VarMeterArrays(NumVarMeterArrays)%OnMeters=0
Found=FindItem(TRIM(ResourceType)//':Facility',EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
IF (Group /= BlankString) THEN
Found=FindItem(TRIM(ResourceType)//':'//TRIM(Group),EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
IF (SameString(Group,'Building')) THEN ! Match to Zone
Found=FindItem(TRIM(ResourceType)//':Zone:'//TRIM(ZoneName),EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
ENDIF
ENDIF
!!! Following if EndUse is by ResourceType
IF (EndUse /= BlankString) THEN
Found=FindItem(TRIM(EndUse)//':'//TRIM(ResourceType),EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
IF (SameString(Group,'Building')) THEN ! Match to Zone
Found=FindItem(TRIM(EndUse)//':'//TRIM(ResourceType)//':Zone:'//TRIM(ZoneName),EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
ENDIF
! End use subcategory
IF (EndUseSub /= BlankString) THEN
Found=FindItem(TRIM(EndUseSub)//':'//TRIM(EndUse)//':'//TRIM(ResourceType),EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
CALL AddEndUseSubcategory(ResourceType, EndUse, EndUseSub)
ENDIF
IF (SameString(Group,'Building')) THEN ! Match to Zone
Found=FindItem(TRIM(EndUseSub)//':'//TRIM(EndUse)//':'//TRIM(ResourceType)//':Zone:'//TRIM(ZoneName), &
EnergyMeters%Name,NumEnergyMeters)
IF (Found /= 0) THEN
VarMeterArrays(NumVarMeterArrays)%NumOnMeters=VarMeterArrays(NumVarMeterArrays)%NumOnMeters+1
VarMeterArrays(NumVarMeterArrays)%OnMeters(VarMeterArrays(NumVarMeterArrays)%NumOnMeters)=Found
ENDIF
ENDIF
ENDIF
ENDIF
RETURN
END SUBROUTINE AttachMeters