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) | :: | Name | |||
character(len=*), | intent(in) | :: | MtrUnits | |||
character(len=*), | intent(in) | :: | ResourceType | |||
character(len=*), | intent(in) | :: | EndUse | |||
character(len=*), | intent(in) | :: | EndUseSub | |||
character(len=*), | intent(in) | :: | Group |
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 AddMeter(Name,MtrUnits,ResourceType,EndUse,EndUseSub,Group)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN January 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine adds a meter to the current definition set of meters. If the maximum has
! already been reached, a reallocation procedure begins. This action needs to be done at the
! start of the simulation, primarily before any output is stored.
! METHODOLOGY EMPLOYED:
! na
! 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) :: Name ! Name for the meter
CHARACTER(len=*), INTENT(IN) :: MtrUnits ! Units for the meter
CHARACTER(len=*), INTENT(IN) :: ResourceType ! ResourceType for the meter
CHARACTER(len=*), INTENT(IN) :: EndUse ! EndUse for the meter
CHARACTER(len=*), INTENT(IN) :: EndUseSub ! EndUse subcategory for the meter
CHARACTER(len=*), INTENT(IN) :: Group ! Group for the meter
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
TYPE (MeterType), &
DIMENSION(:), ALLOCATABLE :: TempMeters
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: Found
LOGICAL :: ErrFlag
! Make sure this isn't already in the list of meter names
IF (NumEnergyMeters > 0) THEN
Found=FindItemInList(Name,EnergyMeters%Name,NumEnergyMeters)
ELSE
Found=0
ENDIF
IF (Found == 0) THEN
IF (NumEnergyMeters > 0) THEN
ALLOCATE(TempMeters(NumEnergyMeters))
TempMeters(1:NumEnergyMeters)=EnergyMeters
DEALLOCATE(EnergyMeters)
ENDIF
ALLOCATE(EnergyMeters(NumEnergyMeters+1))
IF (NumEnergyMeters >0) THEN
EnergyMeters(1:NumEnergyMeters)=TempMeters
DEALLOCATE(TempMeters)
ENDIF
NumEnergyMeters=NumEnergyMeters+1
EnergyMeters(NumEnergyMeters)%Name=Name
EnergyMeters(NumEnergyMeters)%ResourceType=ResourceType
EnergyMeters(NumEnergyMeters)%EndUse=EndUse
EnergyMeters(NumEnergyMeters)%EndUseSub=EndUseSub
EnergyMeters(NumEnergyMeters)%Group=Group
EnergyMeters(NumEnergyMeters)%Units=MtrUnits
EnergyMeters(NumEnergyMeters)%TSValue=0.0d0
EnergyMeters(NumEnergyMeters)%CurTSValue=0.0d0
EnergyMeters(NumEnergyMeters)%RptTS =.false.
EnergyMeters(NumEnergyMeters)%RptTSFO=.false.
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%TSRptNum)
WRITE(EnergyMeters(NumEnergyMeters)%TSRptNumChr,*) EnergyMeters(NumEnergyMeters)%TSRptNum
EnergyMeters(NumEnergyMeters)%TSRptNumChr=ADJUSTL(EnergyMeters(NumEnergyMeters)%TSRptNumChr)
EnergyMeters(NumEnergyMeters)%HRValue=0.0d0
EnergyMeters(NumEnergyMeters)%HRMaxVal=MaxSetValue
EnergyMeters(NumEnergyMeters)%HRMaxValDate=0
EnergyMeters(NumEnergyMeters)%HRMinVal=MinSetValue
EnergyMeters(NumEnergyMeters)%HRMinValDate=0
EnergyMeters(NumEnergyMeters)%RptHR =.false.
EnergyMeters(NumEnergyMeters)%RptHRFO=.false.
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%HRRptNum)
WRITE(EnergyMeters(NumEnergyMeters)%HRRptNumChr,*) EnergyMeters(NumEnergyMeters)%HRRptNum
EnergyMeters(NumEnergyMeters)%HRRptNumChr=ADJUSTL(EnergyMeters(NumEnergyMeters)%HRRptNumChr)
EnergyMeters(NumEnergyMeters)%DYValue=0.0d0
EnergyMeters(NumEnergyMeters)%DYMaxVal=MaxSetValue
EnergyMeters(NumEnergyMeters)%DYMaxValDate=0
EnergyMeters(NumEnergyMeters)%DYMinVal=MinSetValue
EnergyMeters(NumEnergyMeters)%DYMinValDate=0
EnergyMeters(NumEnergyMeters)%RptDY =.false.
EnergyMeters(NumEnergyMeters)%RptDYFO=.false.
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%DYRptNum)
WRITE(EnergyMeters(NumEnergyMeters)%DYRptNumChr,*) EnergyMeters(NumEnergyMeters)%DYRptNum
EnergyMeters(NumEnergyMeters)%DYRptNumChr=ADJUSTL(EnergyMeters(NumEnergyMeters)%DYRptNumChr)
EnergyMeters(NumEnergyMeters)%MNValue=0.0d0
EnergyMeters(NumEnergyMeters)%MNMaxVal=MaxSetValue
EnergyMeters(NumEnergyMeters)%MNMaxValDate=0
EnergyMeters(NumEnergyMeters)%MNMinVal=MinSetValue
EnergyMeters(NumEnergyMeters)%MNMinValDate=0
EnergyMeters(NumEnergyMeters)%RptMN =.false.
EnergyMeters(NumEnergyMeters)%RptMNFO=.false.
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%MNRptNum)
WRITE(EnergyMeters(NumEnergyMeters)%MNRptNumChr,*) EnergyMeters(NumEnergyMeters)%MNRptNum
EnergyMeters(NumEnergyMeters)%MNRptNumChr=ADJUSTL(EnergyMeters(NumEnergyMeters)%MNRptNumChr)
EnergyMeters(NumEnergyMeters)%SMValue=0.0d0
EnergyMeters(NumEnergyMeters)%SMMaxVal=MaxSetValue
EnergyMeters(NumEnergyMeters)%SMMaxValDate=0
EnergyMeters(NumEnergyMeters)%SMMinVal=MinSetValue
EnergyMeters(NumEnergyMeters)%SMMinValDate=0
EnergyMeters(NumEnergyMeters)%RptSM =.false.
EnergyMeters(NumEnergyMeters)%RptSMFO=.false.
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%SMRptNum)
WRITE(EnergyMeters(NumEnergyMeters)%SMRptNumChr,*) EnergyMeters(NumEnergyMeters)%SMRptNum
EnergyMeters(NumEnergyMeters)%SMRptNumChr=ADJUSTL(EnergyMeters(NumEnergyMeters)%SMRptNumChr)
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%TSAccRptNum)
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%HRAccRptNum)
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%DYAccRptNum)
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%MNAccRptNum)
CALL AssignReportNumber(EnergyMeters(NumEnergyMeters)%SMAccRptNum)
ELSE
CALL ShowFatalError('Requested to Add Meter which was already present='//TRIM(Name))
ENDIF
IF (ResourceType /= blankstring) THEN
CALL DetermineMeterIPUnits(EnergyMeters(NumEnergyMeters)%RT_forIPUnits,ResourceType,MtrUnits,ErrFlag)
IF (ErrFlag) THEN
CALL ShowContinueError('..on Meter="'//TRIM(Name)//'".')
CALL ShowContinueError('..requests for IP units from this meter will be ignored.')
ENDIF
! EnergyMeters(NumEnergyMeters)%RT_forIPUnits=DetermineMeterIPUnits(ResourceType,MtrUnits)
ENDIF
! write(outputfiledebug,'(A)') 'add meter=NM='//trim(Name)//'; '// &
! 'RS='//trim(ResourceType)//'; EU='//trim(EndUse)//'; EUS='// &
! trim(EndUseSub)//'; GP='//trim(Group)//'; UT='//trim(MtrUnits)
RETURN
END SUBROUTINE AddMeter