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 ManageWater
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN August 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This is the top-level driver subroutine for managine water systems in the building
! Routine is called at the system timestep level from ManageHVAC
! (somewhat analogous to SimHVAC)
! METHODOLOGY EMPLOYED:
! State variables are continually recalculated each system iteration
! except when appropriate to update them. IF this module is moved up
! to a different timestep (with less iteration), then numerical solution
! may need to be added. Iteration is being used to solve interdependecies
! of storage, supply, and demand modeling of water system.
!
! Most data are declared in data-only module DataWater.f90
!
!
! Calling order,
! storage tanks
! supply
! demands
! IF first/last timestep, then do an update.
! REFERENCES:
! na
! USE STATEMENTS:
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:
LOGICAL,SAVE :: GetInputFlag = .true. ! First time, input is "gotten"
INTEGER :: RainColNum = 0
INTEGER :: TankNum = 0
INTEGER :: WellNum = 0
IF (GetInputFlag) THEN
CALL GetWaterManagerInput
GetInputFlag=.false.
ENDIF
If ( .NOT. (AnyWaterSystemsInModel) ) RETURN
! this is the main water manager
! first call all the water storage tanks
! (these called first to make control decisions)
Do TankNum=1, NumWaterStorageTanks
CALL CalcWaterStorageTank(TankNum)
ENDDO !tank loop
Do RainColNum=1, NumRainCollectors
CALL CalcRainCollector(RainColNum)
ENDDO
Do WellNum=1, NumGroundWaterWells
CALL CalcGroundwaterWell(WellNum)
ENDDO
!call the tanks again to get updated rain and well activity
Do TankNum=1, NumWaterStorageTanks
CALL CalcWaterStorageTank(TankNum)
ENDDO !tank loop
CALL ReportWaterManager
RETURN
END SUBROUTINE ManageWater