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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | IceStorageType | |||
real(kind=r64), | intent(out) | :: | MaxCap | |||
real(kind=r64), | intent(out) | :: | MinCap | |||
real(kind=r64), | intent(out) | :: | OptCap |
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 CalcIceStorageCapacity(IceStorageType,MaxCap,MinCap,OptCap)
! SUBROUTINE INFORMATION:
! PURPOSE OF THIS SUBROUTINE:
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
USE DataGlobals, ONLY: WarmupFlag, NumOfTimeStepInHour, HourOfDay, TimeStep
USE ScheduleManager, ONLY: GetCurrentScheduleValue
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) ::IceStorageType
REAL(r64), INTENT(OUT) :: MaxCap
REAL(r64), INTENT(OUT) :: MinCap
REAL(r64), INTENT(OUT) :: OptCap
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: Umax ! Max Urate [fraction]
REAL(r64) :: Umin ! Min Urate [fraction]
REAL(r64) :: Uact ! Acting between Umax and Umin [fraction]
REAL(r64) :: ITSCoolingRateMax
REAL(r64) :: ITSCoolingRateOpt
REAL(r64) :: ITSCoolingRateMin
REAL(r64) :: QiceMin
! unused REAL(r64) :: Tdb
! FLOW
SELECT CASE(IceStorageType)
CASE(IceStorageType_Simple)
!------------------------------------------------------------------------
! FIRST PROCESS (MyLoad = 0.0 as IN)
! At this moment as first calling of ITS, ITS provide ONLY MaxCap/OptCap/MinCap.
!------------------------------------------------------------------------
! Initialize Capacity
MaxCap = 0.0d0
MinCap = 0.0d0
OptCap = 0.0d0
! Initialize processed Usys values
Umax = 0.0d0
Umin = 0.0d0
Uact = 0.0d0
! XCurIceFrac is reset to 1.0 when first hour of day.
! Starting full is assumed, because most ice systems are fully charged overnight
IF(ResetXForITSFlag) THEN
XCurIceFrac = 1.0d0
IceStorageReport(IceNum)%IceFracRemain = 1.0d0
Urate = 0.0d0
ResetXForITSFlag = .FALSE.
END IF
! Calculate UAIceDisch[W/C] and UAIceCh[W/F] based on ONLY XCurIceFrac
CALL CalcUAIce(IceNum,XCurIceFrac, UAIceCh,UAIceDisCh,HLoss)
! Calculate QiceMin by UAiceDisCh*deltaTlm
! with UAiceDisCh(function of XCurIceFrac), ITSInletTemp and ITSOutletTemp(=Node(OutletNodeNum)%TempSetPoint by E+[C])
! QiceMin is REAL(r64) ITS capacity.
CALL CalcQiceDischageMax(QiceMin)
! Check Umax and Umin to verify the input U value.
Umax = 0.0d0
! At the first call of ITS model, MyLoad is 0. After that proper MyLoad will be provided by E+.
! Therefore, Umin is decided between input U and ITS REAL(r64) capacity.
Umin = MIN( MAX( (-(1.0d0-EpsLimitForDisCharge)*QiceMin*TimeInterval/ITSNomCap), (-XCurIceFrac+EpsLimitForX) ), 0.0d0 )
! Calculate CoolingRate with Uact to provide E+.
Uact = Umin
ITSCoolingRateMax = ABS(Uact*ITSNomCap/TimeInterval)
ITSCoolingRateOpt = ITSCoolingRateMax
ITSCoolingRateMin = 0.0d0
! Define MaxCap, OptCap, and MinCap
MaxCap = ITSCoolingRateMax
OptCap = ITSCoolingRateOpt
MinCap = ITSCoolingRateMin
CASE DEFAULT
END SELECT
RETURN
END SUBROUTINE CalcIceStorageCapacity