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) | :: | MeterName |
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.
FUNCTION GetMeterIndex(MeterName) RESULT(MeterIndex)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN August 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function returns a index to the meter "number" (aka assigned report number)
! for the meter name. If none active for this run, a zero is returned. This is used later to
! obtain a meter "value".
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPrecisionGlobals
USE OutputProcessor
USE InputProcessor, ONLY: MakeUPPERCase,FindItemInSortedList
USE SortAndStringUtilities, ONLY: SetupAndSort
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: MeterName
INTEGER :: MeterIndex
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
! Valid Meter names because matching case insensitive
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:), SAVE :: ValidMeterNames
INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iValidMeterNames
INTEGER,SAVE :: NumValidMeters=0
INTEGER :: Found
LOGICAL,SAVE :: FirstCall=.true.
IF (FirstCall) THEN
NumValidMeters=NumEnergyMeters
ALLOCATE(ValidMeterNames(NumValidMeters))
ALLOCATE(iValidMeterNames(NumValidMeters))
iValidMeterNames=0
DO Found=1,NumValidMeters
ValidMeterNames(Found)=MakeUPPERCase(EnergyMeters(Found)%Name)
ENDDO
FirstCall=.false.
CALL SetupAndSort(ValidMeterNames,iValidMeterNames)
ELSEIF (NumValidMeters /= NumEnergyMeters) THEN
DEALLOCATE(ValidMeterNames)
DEALLOCATE(iValidMeterNames)
NumValidMeters=NumEnergyMeters
ALLOCATE(ValidMeterNames(NumValidMeters))
ALLOCATE(iValidMeterNames(NumValidMeters))
iValidMeterNames=0
DO Found=1,NumValidMeters
ValidMeterNames(Found)=MakeUPPERCase(EnergyMeters(Found)%Name)
ENDDO
CALL SetupAndSort(ValidMeterNames,iValidMeterNames)
ENDIF
MeterIndex=FindItemInSortedList(MakeUPPERCase(MeterName),ValidMeterNames,NumValidMeters)
IF (MeterIndex /= 0) MeterIndex=iValidMeterNames(MeterIndex)
RETURN
END FUNCTION GetMeterIndex