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.
FUNCTION GetInternalVariableValueExternalInterface(varType, keyVarIndex) RESULT (resultVal) !CR - 8481 fix - 08/19/2011
! FUNCTION INFORMATION:
! AUTHOR Thierry S. Nouidui
! DATE WRITTEN August 2011
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function returns the last zone-timestep 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(r64), 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(r64), 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('GetInternalVariableValueExternalInterface: passed index beyond range of array.')
ENDIF
IF (keyVarIndex .LT. 1) THEN
CALL ShowFatalError('GetInternalVariableValueExternalInterface: passed index beyond range of array.')
ENDIF
IVar=>IVariableTypes(keyVarIndex)%VarPtr
! must use %EITSValue, %This is the last-zonetimestep value
resultVal = REAL(IVar%EITSValue,r64)
CASE (2) ! REAL(r64)
IF (keyVarIndex .GT. NumOfRVariable) THEN
CALL ShowFatalError('GetInternalVariableValueExternalInterface: passed index beyond range of array.')
ENDIF
IF (keyVarIndex .LT. 1) THEN
CALL ShowFatalError('GetInternalVariableValueExternalInterface: passed index beyond range of array.')
ENDIF
RVar=>RVariableTypes(keyVarIndex)%VarPtr
! must use %EITSValue, %This is the last-zonetimestep value
resultVal = RVar%EITSValue
CASE (3) ! Meter
resultVal = GetCurrentMeterValue(keyVarIndex)
CASE (4) ! Schedule
resultVal = GetCurrentScheduleValue(keyVarIndex)
CASE DEFAULT
resultVal = 0.0d0
END SELECT
END FUNCTION GetInternalVariableValueExternalInterface