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.
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 InitDetailedIceStorage
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN February 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine initializes variables for the detailed ice storage model.
! METHODOLOGY EMPLOYED:
! Initializes parameters based on current status flag values.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY : BeginEnvrnFlag
USE DataPlant, ONLY : ScanPlantLoopsForObject, PlantLoop, TypeOf_TS_IceDetailed, CommonPipe_TwoWay, &
SupplySide, LoopFlowStatus_NeedyAndTurnsLoopOn
USE PlantUtilities, ONLY: InitComponentNodes
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 :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyPlantScanFlag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyEnvrnFlag
INTEGER :: CompNum ! local do loop index
! FLOW:
IF (MyOneTimeFlag) THEN
ALLOCATE(MyPlantScanFlag(NumDetIceStorages))
ALLOCATE(MyEnvrnFlag(NumDetIceStorages))
MyPlantScanFlag = .TRUE.
MyEnvrnFlag = .TRUE.
MyOneTimeFlag = .FALSE.
ENDIF
IF (MyPlantScanFlag(IceNum)) THEN
CALL ScanPlantLoopsForObject( DetIceStor(IceNum)%Name, &
TypeOf_TS_IceDetailed, &
DetIceStor(IceNum)%PlantLoopNum, &
DetIceStor(IceNum)%PlantLoopSideNum, &
DetIceStor(IceNum)%PlantBranchNum, &
DetIceStor(IceNum)%PlantCompNum)
MyPlantScanFlag(IceNum) = .FALSE.
ENDIF
IF (BeginEnvrnFlag .AND. MyEnvrnFlag(IceNum)) THEN ! Beginning of environment initializations
! Make sure all state variables are reset at the beginning of every environment to avoid problems.
! The storage unit is assumed to be fully charged at the start of any environment.
! The IceNum variable is a module level variable that is already set before this subroutine is called.
DetIceStor(IceNum)%IceFracChange = 0.0d0
DetIceStor(IceNum)%IceFracRemaining = 1.0d0
DetIceStor(IceNum)%IceFracOnCoil = 1.0d0
DetIceStor(IceNum)%InletTemp = 0.0d0
DetIceStor(IceNum)%OutletTemp = 0.0d0
DetIceStor(IceNum)%TankOutletTemp = 0.0d0
DetIceStor(IceNum)%DischargeIterErrors = 0
DetIceStor(IceNum)%ChargeIterErrors = 0
DetIceStor(IceNum)%DesignMassFlowRate = PlantLoop(DetIceStor(IceNum)%PlantLoopNum)%MaxMassFlowRate
!no design flow rates for model, assume min is zero and max is plant loop's max
CALL InitComponentNodes( 0.0d0, DetIceStor(IceNum)%DesignMassFlowRate, &
DetIceStor(IceNum)%PlantInNodeNum, &
DetIceStor(IceNum)%PlantOutNodeNum, &
DetIceStor(IceNum)%PlantLoopNum, &
DetIceStor(IceNum)%PlantLoopSideNum, &
DetIceStor(IceNum)%PlantBranchNum, &
DetIceStor(IceNum)%PlantCompNum)
IF ((PlantLoop(DetIceStor(IceNum)%PlantLoopNum)%CommonPipeType == CommonPipe_TwoWay) .AND. &
(DetIceStor(IceNum)%PlantLoopSideNum == SupplySide)) THEN
! up flow priority of other components on the same branch as the Ice tank
DO CompNum = 1, PlantLoop(DetIceStor(IceNum)%PlantLoopNum)%LoopSide(SupplySide)% &
Branch(DetIceStor(IceNum)%PlantBranchNum)%TotalComponents
PlantLoop(DetIceStor(IceNum)%PlantLoopNum)%LoopSide(SupplySide)% &
Branch(DetIceStor(IceNum)%PlantBranchNum)%Comp(CompNum)%FlowPriority = LoopFlowStatus_NeedyAndTurnsLoopOn
ENDDO
ENDIF
MyEnvrnFlag(IceNum) = .FALSE.
END IF
IF (.NOT. BeginEnvrnFlag) MyEnvrnFlag(IceNum) = .TRUE.
! Initializations that are done every iteration
! Make sure all of the reporting variables are always reset at the start of any iteration
DetIceStor(IceNum)%CompLoad = 0.0d0
DetIceStor(IceNum)%IceFracChange = 0.0d0
DetIceStor(IceNum)%DischargingRate = 0.0d0
DetIceStor(IceNum)%DischargingEnergy = 0.0d0
DetIceStor(IceNum)%ChargingRate = 0.0d0
DetIceStor(IceNum)%ChargingEnergy = 0.0d0
DetIceStor(IceNum)%MassFlowRate = 0.0d0
DetIceStor(IceNum)%BypassMassFlowRate = 0.0d0
DetIceStor(IceNum)%TankMassFlowRate = 0.0d0
DetIceStor(IceNum)%ParasiticElecRate = 0.0d0
DetIceStor(IceNum)%ParasiticElecEnergy = 0.0d0
RETURN
END SUBROUTINE InitDetailedIceStorage