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 | ||
---|---|---|---|---|---|---|
logical, | intent(inout) | :: | ErrorsFound |
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.
SUBROUTINE SetupSimulation(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith/L. Lawrie
! DATE WRITTEN May 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! execute a few time steps of a simulation to facilitate setting up model
! developed to resolve reverse DD problems caused be the differences
! that stem from setup and information gathering that occurs during the first pass.
! METHODOLOGY EMPLOYED:
! Using global flag (kickoff simulation), only a few time steps are executed.
! global flag is used in other parts of simulation to terminate quickly.
! REFERENCES:
! na
! USE STATEMENTS:
USE ExteriorEnergyUse, ONLY: ManageExteriorEnergyUse
USE DataEnvironment , ONLY: EndMonthFlag, EnvironmentName
USE InputProcessor, ONLY: GetNumRangeCheckErrorsFound
USE CostEstimateManager, ONLY: SimCostEstimate
USE General, ONLY: TrimSigDigits
USE DataTimings
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: Available=.false. ! an environment is available to process
! integer :: env_iteration=0
! CHARACTER(len=32) :: cEnvChar
! return ! remove comment to do 'old way'
Available = .true.
DO WHILE (Available) ! do for each environment
CALL GetNextEnvironment(Available,ErrorsFound)
IF (.not. Available) EXIT
IF (ErrorsFound) EXIT
BeginEnvrnFlag = .TRUE.
EndEnvrnFlag = .FALSE.
EndMonthFlag = .FALSE.
WarmupFlag = .TRUE.
DayOfSim = 0
DayOfSim = DayOfSim + 1
BeginDayFlag = .TRUE.
EndDayFlag = .FALSE.
HourOfDay = 1
BeginHourFlag = .TRUE.
EndHourFlag = .FALSE.
TimeStep = 1
IF (DeveloperFlag) CALL DisplayString('Initializing Simulation - timestep 1:'//trim(EnvironmentName))
BeginTimeStepFlag = .TRUE.
CALL ManageWeather
CALL ManageExteriorEnergyUse
CALL ManageHeatBalance
! After the first iteration of HeatBalance, all the 'input' has been gotten
IF (BeginFullSimFlag) THEN
IF (GetNumRangeCheckErrorsFound() > 0) THEN
CALL ShowFatalError('Out of "range" values found in input')
ENDIF
ENDIF
BeginHourFlag = .FALSE.
BeginDayFlag = .FALSE.
BeginEnvrnFlag = .FALSE.
BeginSimFlag = .FALSE.
BeginFullSimFlag = .FALSE.
! ! do another timestep=1
IF (DeveloperFlag) CALL DisplayString('Initializing Simulation - 2nd timestep 1:'//trim(EnvironmentName))
CALL ManageWeather
CALL ManageExteriorEnergyUse
CALL ManageHeatBalance
! do an end of day, end of environment time step
HourOfDay=24
TimeStep=NumOfTimeStepInHour
EndEnvrnFlag = .True.
IF (DeveloperFlag) CALL DisplayString('Initializing Simulation - hour 24 timestep 1:'//trim(EnvironmentName))
CALL ManageWeather
CALL ManageExteriorEnergyUse
CALL ManageHeatBalance
END DO ! ... End environment loop.
IF (.not. ErrorsFound) CALL SimCostEstimate ! basically will get and check input
IF (ErrorsFound) CALL ShowFatalError('Previous Conditions cause program termination.')
RETURN
END SUBROUTINE SetupSimulation