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) | :: | TowerType | |||
character(len=*), | intent(in) | :: | TowerName | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(inout) | :: | RunFlag | |||
logical, | intent(in) | :: | InitLoopEquip | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
real(kind=r64), | intent(inout) | :: | MaxCap | |||
real(kind=r64), | intent(inout) | :: | MinCap | |||
real(kind=r64), | intent(inout) | :: | OptCap | |||
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 SimTowers(TowerType,TowerName, CompIndex, RunFlag,InitLoopEquip, MyLoad, &
MaxCap,MinCap,OptCap,GetSizingFactor,SizingFactor)
! SUBROUTINE INFORMATION:
! AUTHOR Don Shirey
! DATE WRITTEN Dec. 2000
! MODIFIED Fred Buhl, May 2002; Richard Raustad, FSEC, Feb 2005 (added VS tower)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Main cooling tower driver subroutine. Gets called from
! PlantLoopEquipments.
! METHODOLOGY EMPLOYED:
! After being called by PlantLoopEquipments, this subroutine
! calls GetTowerInput to get all cooling tower input info (one time only),
! then calls the appropriate subroutine to calculate tower performance,
! update records (node info) and writes output report info.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE DataPlant, ONLY: PlantSizesOkayToFinalize
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*),INTENT(IN) :: TowerType
CHARACTER(len=*),INTENT(IN) :: TowerName
INTEGER,INTENT(INOUT) :: CompIndex
LOGICAL,INTENT(INOUT) :: RunFlag
LOGICAL, INTENT(IN) :: InitLoopEquip
REAL(r64),INTENT(INOUT) :: MyLoad
REAL(r64),INTENT(INOUT) :: OptCap
REAL(r64),INTENT(INOUT) :: MaxCap
REAL(r64),INTENT(INOUT) :: MinCap
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:
LOGICAL, SAVE :: GetInput = .TRUE.
INTEGER :: TowerNum
!GET INPUT
IF (GetInput) THEN
CALL GetTowerInput
GetInput = .FALSE.
END IF
! Find the correct CoolingTower
IF (CompIndex == 0) THEN
TowerNum=FindItemInList(TowerName,SimpleTower%Name,NumSimpleTowers)
IF (TowerNum == 0) THEN
CALL ShowFatalError('SimTowers: Unit not found='//TRIM(TowerName))
ENDIF
CompIndex=TowerNum
ELSE
TowerNum=CompIndex
IF (TowerNum > NumSimpleTowers .or. TowerNum < 1) THEN
CALL ShowFatalError('SimTowers: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(TowerNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumSimpleTowers))// &
', Entered Unit name='//TRIM(TowerName))
ENDIF
IF (CheckEquipName(TowerNum)) THEN
IF (TowerName /= SimpleTower(TowerNum)%Name) THEN
CALL ShowFatalError('SimTowers: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(TowerNum))// &
', Unit name='//TRIM(TowerName)//', stored Unit Name for that index='// &
TRIM(SimpleTower(TowerNum)%Name))
ENDIF
CheckEquipName(TowerNum)=.false.
ENDIF
ENDIF
!INITIALIZE
CALL InitSimVars
!CALCULATE
TypeOfEquip: &
SELECT CASE (SimpleTower(TowerNum)%TowerType_Num)
CASE (CoolingTower_SingleSpeed)
IF (InitLoopEquip) THEN
CALL InitTower(TowerNum, RunFlag)
CALL SizeTower(TowerNum)
MinCap = 0.0d0
MaxCap = SimpleTower(TowerNum)%TowerNominalCapacity &
* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
OptCap = SimpleTower(TowerNum)%TowerNominalCapacity
IF (GetSizingFactor) THEN
SizingFactor = SimpleTower(TowerNum)%SizFac
END IF
RETURN
END IF
CALL InitTower(TowerNum, RunFlag)
CALL CalcSingleSpeedTower(TowerNum)
CALL CalculateWaterUseage(TowerNum)
CALL UpdateTowers(TowerNum)
CALL ReportTowers(RunFlag,TowerNum)
CASE (CoolingTower_TwoSpeed)
IF (InitLoopEquip) THEN
CALL InitTower(TowerNum, RunFlag)
CALL SizeTower(TowerNum)
MinCap = 0.0d0
MaxCap = SimpleTower(TowerNum)%TowerNominalCapacity &
* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
OptCap = SimpleTower(TowerNum)%TowerNominalCapacity
IF (GetSizingFactor) THEN
SizingFactor = SimpleTower(TowerNum)%SizFac
END IF
RETURN
END IF
CALL InitTower(TowerNum, RunFlag)
CALL CalcTwoSpeedTower(TowerNum)
CALL CalculateWaterUseage(TowerNum)
CALL UpdateTowers(TowerNum)
CALL ReportTowers(RunFlag,TowerNum)
CASE (CoolingTower_VariableSpeedMerkel)
IF (InitLoopEquip) THEN
CALL InitTower(TowerNum, RunFlag)
CALL SizeVSMerkelTower(TowerNum)
MinCap = 0.0d0
MaxCap = SimpleTower(TowerNum)%TowerNominalCapacity &
* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
OptCap = SimpleTower(TowerNum)%TowerNominalCapacity
IF (GetSizingFactor) THEN
SizingFactor = SimpleTower(TowerNum)%SizFac
END IF
RETURN
END IF
CALL InitTower(TowerNum, RunFlag)
CALL CalcMerkelVariableSpeedTower(TowerNum, MyLoad)
CALL CalculateWaterUseage(TowerNum)
CALL UpdateTowers(TowerNum)
CALL ReportTowers(RunFlag,TowerNum)
CASE (CoolingTower_VariableSpeed)
IF (InitLoopEquip) THEN
CALL InitTower(TowerNum, RunFlag)
CALL SizeTower(TowerNum)
MinCap = 0.0d0
MaxCap = SimpleTower(TowerNum)%TowerNominalCapacity &
* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
OptCap = SimpleTower(TowerNum)%TowerNominalCapacity
IF (GetSizingFactor) THEN
SizingFactor = SimpleTower(TowerNum)%SizFac
END IF
RETURN
END IF
CALL InitTower(TowerNum, RunFlag)
CALL CalcVariableSpeedTower(TowerNum)
CALL CalculateWaterUseage(TowerNum)
CALL UpdateTowers(TowerNum)
CALL ReportTowers(RunFlag,TowerNum)
CASE DEFAULT
CALL ShowFatalError('SimTowers: Invalid Tower Type Requested='//TRIM(TowerType))
END SELECT TypeOfEquip
RETURN
END SUBROUTINE SimTowers