Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | Trange | |||
real(kind=r64), | intent(in), | optional | DIMENSION(:) | :: | Par |
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.
FUNCTION SimpleTowerTrResidual(Trange, Par) RESULT (Residuum)
! FUNCTION INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN Feb 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Calculates residual function (where residual shows a balance point of model and desired performance)
! Tower Approach depends on the range temperature which is being varied to zero the residual.
! METHODOLOGY EMPLOYED:
! Varies tower range temperature until a balance point exists where the model output corresponds
! to the desired independent variables
! REFERENCES:
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: Trange ! cooling tower range temperature [C]
REAL(r64), INTENT(IN), DIMENSION(:), OPTIONAL :: Par ! par(1) = tower number
! par(2) = water flow ratio
! par(3) = air flow ratio
! par(4) = inlet air wet-bulb temperature [C]
REAL(r64) :: Residuum ! residual to be minimized to zero
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: TowerIndex ! index of this tower
REAL(r64) :: WaterFlowRateRatio ! ratio of water flow rate to design water flow rate
REAL(r64) :: AirFlowRateRatio ! ratio of water flow rate to design water flow rate
REAL(r64) :: InletAirWB ! inlet air wet-bulb temperature [C]
REAL(r64) :: Tapproach ! tower approach temperature [C]
TowerIndex = INT(Par(1))
WaterFlowRateRatio = Par(2)
AirFlowRateRatio = Par(3)
InletAirWB = Par(4)
Tapproach = 0.0d0
! call model to determine approach temperature given other independent variables (range temp is being varied to find balance)
CALL CalcVSTowerApproach(TowerIndex,WaterFlowRateRatio,AirFlowRateRatio,InletAirWB,Trange,Tapproach)
! calculate residual based on a balance where Twb + Ta + Tr = Node(WaterInletNode)%Temp
Residuum = (InletAirWB+Tapproach+Trange)- &
Node(SimpleTower(TowerIndex)%WaterInletNodeNum)%Temp
RETURN
END FUNCTION SimpleTowerTrResidual