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) | :: | PumpName | |||
integer, | intent(in) | :: | LoopNum | |||
real(kind=r64), | intent(in) | :: | FlowRequest | |||
logical, | intent(out) | :: | PumpRunning | |||
integer, | intent(inout) | :: | PumpIndex | |||
real(kind=r64), | intent(out) | :: | PumpHeat |
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 SimPumps(PumpName, LoopNum, FlowRequest, PumpRunning, PumpIndex, PumpHeat)
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN July 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages the pump operation based on the type of
! pump and the pump controls (continuous, intermittent, etc.). The
! result of this subroutine is that the pump has been simulated for
! the necessary loop and the PumpRunning has been correctly set.
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE DataPlant, ONLY: PlantLoop, FlowPumpQuery
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: PumpName ! Name of pump to be managed
INTEGER, INTENT(IN) :: LoopNum ! Plant loop number
REAL(r64), INTENT(IN) :: FlowRequest ! requested flow from adjacent demand side
LOGICAL, INTENT(OUT) :: PumpRunning ! .TRUE. if the loop pump is actually operating
INTEGER, INTENT(IN OUT) :: PumpIndex
REAL(r64), INTENT(OUT) :: PumpHeat
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: GetInputFlag = .TRUE. ! Get input once and once only
INTEGER :: PumpNum ! Pump index within PumpEquip derived type
! Get input from IDF one time
IF (GetInputFlag) THEN
CALL GetPumpInput
GetInputFlag=.false.
END IF
! Exit early if no pumps found
IF (NumPumps == 0) THEN
PumpHeat=0.0d0
RETURN
ENDIF
! Setup pump component index if needed
IF (PumpIndex == 0) THEN
PumpNum = FindItemInList(PumpName,PumpEquip%Name,NumPumps) ! Determine which pump to simulate
IF (PumpNum == 0) THEN
CALL ShowFatalError('ManagePumps: Pump requested not found ='//TRIM(PumpName)) ! Catch any bad names before crashing
ENDIF
PumpIndex=PumpNum
ELSE
PumpNum=PumpIndex
IF (PumpEquip(PumpNum)%CheckEquipName) THEN
IF (PumpNum > NumPumps .or. PumpNum < 1) THEN
CALL ShowFatalError('ManagePumps: Invalid PumpIndex passed='//TRIM(TrimSigDigits(PumpNum))// &
', Number of Pumps='//TRIM(TrimSigDigits(NumPumps))//', Pump name='//TRIM(PumpName))
ENDIF
IF (PumpName /= PumpEquip(PumpNum)%Name) THEN
CALL ShowFatalError('ManagePumps: Invalid PumpIndex passed='//TRIM(TrimSigDigits(PumpNum))// &
', Pump name='//TRIM(PumpName)//', stored Pump Name for that index='//TRIM(PumpEquip(PumpNum)%Name))
ENDIF
PumpEquip(PumpNum)%CheckEquipName=.FALSE.
ENDIF
ENDIF
! Perform one-time and begin-environment initialization
CALL InitializePumps(PumpNum)
! If all we need is to set outlet min/max avail, then just do it and get out. Also, we only do min/max avail on flow query
IF (PlantLoop(LoopNum)%LoopSide(PumpEquip(PumpNum)%LoopSideNum)%FlowLock == FlowPumpQuery) THEN
CALL SetupPumpMinMaxFlows(LoopNum, PumpNum)
RETURN
END IF
! Set pump flow rate and calculate power
CALL CalcPumps(PumpNum, FlowRequest, PumpRunning)
! Update pump reporting data
CALL ReportPumps(PumpNum)
! Send this up to the calling routine
PumpHeat = PumpHeattoFluid
RETURN
END SUBROUTINE SimPumps