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.
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 BeginEnvrnInitializeRuntimeLanguage
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN March 2010
! MODIFIED B. Griffith, added Sensor initialation
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! re initialize Erl for new simulation environment period
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
Use OutputProcessor , ONLY : SetInternalVariableValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ActuatorUsedLoop
INTEGER :: EMSActuatorVariableNum
INTEGER :: ErlVariableNum
INTEGER :: TrendVarNum
INTEGER :: SensorNum
INTEGER :: TrendDepth
INTEGER :: Loop
LOGICAL :: CycleThisVariable
!reinitialize state of Erl variable values to zero, this gets sensors and internal variables used
DO ErlVariableNum = 1, NumErlVariables
!but skip constant built-in variables so don't overwrite them
IF (ErlVariableNum == NullVariableNum) CYCLE
IF (ErlVariableNum == FalseVariableNum) CYCLE
IF (ErlVariableNum == TrueVariableNum) CYCLE
IF (ErlVariableNum == OffVariableNum) CYCLE
IF (ErlVariableNum == OnVariableNum) CYCLE
IF (ErlVariableNum == PiVariableNum) CYCLE
IF (ErlVariableNum == ZoneTimeStepVariableNum) CYCLE
IF (ErlVariableNum == ActualDateAndTimeNum) CYCLE
IF (ErlVariableNum == ActualTimeNum) CYCLE
! need to preserve curve index variables
CycleThisVariable = .FALSE.
DO Loop = 1, NumEMSCurveIndices
IF ( ErlVariableNum == CurveIndexVariableNums(Loop)) CycleThisVariable = .TRUE.
ENDDO
IF (CycleThisVariable) CYCLE
CycleThisVariable = .FALSE.
DO Loop = 1, NumEMSConstructionIndices
IF ( ErlVariableNum == ConstructionIndexVariableNums(Loop)) CycleThisVariable = .TRUE.
ENDDO
IF (CycleThisVariable) CYCLE
ErlVariable(ErlVariableNum)%Value = SetErlValueNumber(0.0D0, &
OrigValue = ErlVariable(ErlVariableNum)%Value)
ENDDO
!reinitialize state of actuators
DO ActuatorUsedLoop = 1, NumActuatorsUsed + NumExternalInterfaceActuatorsUsed
EMSActuatorVariableNum = EMSActuatorUsed(ActuatorUsedLoop)%ActuatorVariableNum
ErlVariableNum = EMSActuatorUsed(ActuatorUsedLoop)%ErlVariableNum
ErlVariable(ErlVariableNum)%Value%TYPE = ValueNull
EMSActuatorAvailable(EMSActuatorVariableNum)%Actuated = .FALSE.
SELECT CASE (EMSActuatorAvailable(EMSActuatorVariableNum)%PntrVarTypeUsed)
CASE (PntrReal)
EMSActuatorAvailable(EMSActuatorVariableNum)%RealValue = 0.0D0
CASE (PntrInteger)
EMSActuatorAvailable(EMSActuatorVariableNum)%IntValue = 0
CASE (PntrLogical)
EMSActuatorAvailable(EMSActuatorVariableNum)%LogValue = .FALSE.
END SELECT
ENDDO
!reinitialize trend variables so old data are purged
DO TrendVarNum = 1, NumErlTrendVariables
TrendDepth = TrendVariable(TrendVarNum)%LogDepth
TrendVariable(TrendVarNum)%TrendValARR(1:TrendDepth) = 0.0D0
ENDDO
! reinitilize sensors
DO SensorNum = 1, NumSensors
CALL SetInternalVariableValue(Sensor(SensorNum)%Type, Sensor(SensorNum)%Index, 0.d0,0)
ENDDO
RETURN
END SUBROUTINE BeginEnvrnInitializeRuntimeLanguage