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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | SourceName | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
logical, | intent(inout) | :: | InitLoopEquip | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
real(kind=r64), | intent(inout) | :: | MaxLoad | |||
real(kind=r64), | intent(inout) | :: | MinLoad | |||
real(kind=r64), | intent(inout) | :: | OptLoad | |||
logical, | intent(in) | :: | GetSizingFactor | |||
real(kind=r64), | intent(inout) | :: | SizingFactor |
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 SimWaterSource(SourceName,EquipFlowCtrl,CompIndex,RunFlag,FirstHVACIteration, &
InitLoopEquip,MyLoad,MaxLoad,MinLoad,OptLoad,GetSizingFactor,SizingFactor)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN October 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE: This is the water source model driver. It
! gets the input for the models, initializes simulation variables, call
! the appropriate model and sets up reporting variables.
! METHODOLOGY EMPLOYED: na
! REFERENCES: na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE DataGlobals, ONLY: BigNumber
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: SourceName ! user-specified name for this component
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER, INTENT(INOUT) :: CompIndex ! HX number pointer
LOGICAL , INTENT(IN) :: RunFlag ! simulate HX when TRUE
LOGICAL , INTENT(IN) :: FirstHVACIteration ! initialize variables when TRUE
LOGICAL, INTENT(INOUT) :: InitLoopEquip ! If not zero, calculate the max load for operating conditions
REAL(r64), INTENT(INOUT) :: MyLoad ! loop demand component will meet
REAL(r64), INTENT(INOUT) :: MaxLoad
REAL(r64), INTENT(INOUT) :: MinLoad
REAL(r64), INTENT(INOUT) :: OptLoad
LOGICAL, INTENT(IN) :: GetSizingFactor ! TRUE when just the sizing factor is requested
REAL(r64), INTENT(INOUT) :: SizingFactor ! sizing factor
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: SourceNum ! HX number pointer
!GET INPUT
IF (GetInput) THEN
CALL GetWaterSource()
GetInput = .FALSE.
END IF
! Find the correct Chiller
IF (CompIndex == 0) THEN
SourceNum = FindItemInList(SourceName,WaterSource%Name,NumSources)
IF (SourceNum == 0) THEN
CALL ShowFatalError('SimWaterSource: Specified heat exchanger not one of Valid heat exchangers='//TRIM(SourceName))
ENDIF
CompIndex=SourceNum
ELSE
SourceNum=CompIndex
IF (SourceNum > NumSources .or. SourceNum < 1) THEN
CALL ShowFatalError('SimWaterSource: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(SourceNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumSources))// &
', Entered Unit name='//TRIM(SourceName))
ENDIF
IF (WaterSource(SourceNum)%CheckEquipName) THEN
IF (SourceName /= WaterSource(SourceNum)%Name) THEN
CALL ShowFatalError('SimWaterSource: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(SourceNum))// &
', Unit name='//TRIM(SourceName)//', stored Unit Name for that index='// &
TRIM(WaterSource(SourceNum)%Name))
ENDIF
WaterSource(SourceNum)%CheckEquipName=.false.
ENDIF
ENDIF
IF (InitLoopEquip) THEN
CALL InitWaterSource(SourceNum,RunFlag,MyLoad,FirstHVACIteration)
CALL SizeWaterSource(SourceNum)
IF (GetSizingFactor) THEN
SizingFactor = WaterSource(SourceNum)%SizFac
END IF
MaxLoad = BigNumber
MinLoad = 0.0d0
OptLoad = BigNumber
RETURN
END IF
CALL InitWaterSource(SourceNum,RunFlag,MyLoad,FirstHVACIteration)
CALL CalcWaterSource(SourceNum,MyLoad,Runflag,EquipFlowCtrl)
CALL UpdateWaterSource(SourceNum)
RETURN
END SUBROUTINE SimWaterSource