SUBROUTINE SetInternalVariableValue(varType, keyVarIndex, SetRealVal, SetIntVal)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN August 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This is a simple set routine for output pointers
! It is intended for special use to reinitializations those pointers used for EMS sensors
! METHODOLOGY EMPLOYED:
! given a variable type and variable index,
! assign the pointers the values passed in.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: varType ! 1=integer, 2=real, 3=meter
INTEGER, INTENT(IN) :: keyVarIndex ! Array index
REAL(r64), INTENT(IN) :: SetRealVal ! real value to set, if type is real or meter
INTEGER, INTENT(IN) :: SetIntVal ! integer value to set if type is integer
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
SELECT CASE (varType)
CASE (1) ! Integer
IVar=>IVariableTypes(keyVarIndex)%VarPtr
IVar%Which = SetIntVal
CASE (2) ! real
RVar=>RVariableTypes(keyVarIndex)%VarPtr
RVar%Which = setRealVal
CASE (3) ! meter
EnergyMeters(keyVarIndex)%CurTSValue = setRealVal
END SELECT
RETURN
END SUBROUTINE SetInternalVariableValue