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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | varType | |||
integer, | intent(in) | :: | keyVarIndex |
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 GetInternalVariableValue(varType, keyVarIndex) RESULT (resultVal)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN December 2000
! MODIFIED August 2003, M. J. Witte
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function returns the current value of the Internal Variable assigned to
! the varType and keyVarIndex. Values may be accessed for REAL(r64) and integer
! report variables and meter variables. The variable type (varType) may be
! determined by calling subroutine and GetVariableKeyCountandType. The
! index (keyVarIndex) may be determined by calling subroutine GetVariableKeys.
! METHODOLOGY EMPLOYED:
! Uses Internal OutputProcessor data structure to return value.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPrecisionGlobals
USE OutputProcessor
USE ScheduleManager, ONLY: GetCurrentScheduleValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: keyVarIndex ! Array index
INTEGER, INTENT(IN) :: varType ! 1=integer, 2=real, 3=meter
REAL(r64) :: resultVal ! value returned
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
! na
REAL(r64), external :: GetCurrentMeterValue
! Select based on variable type: integer, real, or meter
SELECT CASE (varType)
CASE (0) ! Variable not a found variable
resultVal = 0.0d0
CASE (1) ! Integer
IF (keyVarIndex .GT. NumOfIVariable) THEN
CALL ShowFatalError('GetInternalVariableValue: passed index beyond range of array.')
ENDIF
IF (keyVarIndex .LT. 1) THEN
CALL ShowFatalError('GetInternalVariableValue: passed index beyond range of array.')
ENDIF
IVar=>IVariableTypes(keyVarIndex)%VarPtr
! must use %Which, %Value is always zero if variable is not a requested report variable
resultVal = REAL(IVar%Which,r64)
CASE (2) ! real
IF (keyVarIndex .GT. NumOfRVariable) THEN
CALL ShowFatalError('GetInternalVariableValue: passed index beyond range of array.')
ENDIF
IF (keyVarIndex .LT. 1) THEN
CALL ShowFatalError('GetInternalVariableValue: passed index beyond range of array.')
ENDIF
RVar=>RVariableTypes(keyVarIndex)%VarPtr
! must use %Which, %Value is always zero if variable is not a requested report variable
resultVal = RVar%Which
CASE (3) ! Meter
resultVal = GetCurrentMeterValue(keyVarIndex)
CASE (4) ! Schedule
resultVal = GetCurrentScheduleValue(keyVarIndex)
CASE DEFAULT
resultVal = 0.0d0
END SELECT
END FUNCTION GetInternalVariableValue