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) | :: | SensorNodeNum | |||
integer, | intent(in) | :: | ControlledVar | |||
logical, | intent(out) | :: | NodeNotFound |
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 CheckForSensorAndSetpointNode(SensorNodeNum,ControlledVar,NodeNotFound)
! SUBROUTINE INFORMATION:
! AUTHOR Bereket Nigusse
! DATE WRITTEN March 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine checks that the sensor node number matches the air outlet node number
! of some water coils
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE SetPointManager, ONLY: NodeHasSPMCtrlVarType, iCtrlVarType_Temp, iCtrlVarType_HumRat, iCtrlVarType_MaxHumRat
USE EMSManager, ONLY: CheckIfNodeSetpointManagedByEMS, iTemperatureSetpoint, iHumidityRatioMaxSetpoint
!USE HVACControllers, ONLY: iTemperature, iHumidityRatio, iTemperatureAndHumidityRatio
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: SensorNodeNum ! controller sensor node number
INTEGER, INTENT(IN) :: ControlledVar ! controlled variable type
LOGICAL, INTENT(OUT) :: NodeNotFound ! true if matching air outlet node not found
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='CheckForSensorAndSetpointNode: '
INTEGER, PARAMETER :: iTemperature = 1
INTEGER, PARAMETER :: iHumidityRatio = 2
INTEGER, PARAMETER :: iTemperatureAndHumidityRatio = 3
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: WhichCoil ! water coil index
INTEGER :: CoilNum ! counter
CHARACTER(len=40) :: WaterCoilType ! water coil type
LOGICAL :: EMSSetpointErrorFlag ! flag true is EMS is used to set node setpoints
! Obtains and Allocates DXCoils
IF (GetWaterCoilsInputFlag) THEN
CALL GetWaterCoilInput
GetWaterCoilsInputFlag = .FALSE.
END IF
WhichCoil = 0
NodeNotFound = .TRUE.
DO CoilNum = 1, NumWaterCoils
IF (SensorNodeNum /= WaterCoil(CoilNum)%AirOutletNodeNum) CYCLE
NodeNotFound = .FALSE.
WhichCoil = CoilNum
EXIT
END DO
! now if the sensor node is on the water coil air outlet node then check that
! a setpoint is also specified on the water coil outlet node
IF ( .NOT. NodeNotFound) THEN
IF ( WhichCoil > 0) THEN
If(WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_DetFlatFinCooling) Then
WaterCoilType = 'Coil:Cooling:Water:DetailedGeometry'
ElseIf(WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_Cooling) Then
WaterCoilType = 'Coil:Cooling:Water'
ELSEIf(WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_SimpleHeating) Then
WaterCoilType = 'Coil:Heating:Water'
ENDIF
EMSSetpointErrorFlag = .FALSE.
SELECT CASE (ControlledVar)
CASE (iTemperature)
CALL CheckIfNodeSetpointManagedByEMS(SensorNodeNum,iTemperatureSetpoint, EMSSetpointErrorFlag)
IF (EMSSetpointErrorFlag) THEN
IF(.NOT. NodeHasSPMCtrlVarType(SensorNodeNum, iCtrlVarType_Temp)) THEN
CALL ShowWarningError(RoutineName//TRIM(WaterCoilType)//'="'//TRIM(WaterCoil(WhichCoil)%Name)//'". ')
CALL ShowContinueError(' ..Temperature setpoint not found on coil air outlet node.')
CALL ShowContinueError(' ..The setpoint may have been placed on a node downstream of the coil'// &
' or on an airloop outlet node.')
CALL ShowContinueError(' ..Specify the setpoint and the sensor on the coil air outlet node when possible.')
END IF
ENDIF
CASE (iHumidityRatio)
CALL CheckIfNodeSetpointManagedByEMS(SensorNodeNum,iHumidityRatioMaxSetpoint, EMSSetpointErrorFlag)
IF (EMSSetpointErrorFlag) THEN
IF(.NOT. NodeHasSPMCtrlVarType(SensorNodeNum, iCtrlVarType_MaxHumRat)) THEN
CALL ShowWarningError(RoutineName//TRIM(WaterCoilType)//'="'//TRIM(WaterCoil(WhichCoil)%Name)//'". ')
CALL ShowContinueError(' ..Humidity ratio setpoint not found on coil air outlet node.')
CALL ShowContinueError(' ..The setpoint may have been placed on a node downstream of the coil'// &
' or on an airloop outlet node.')
CALL ShowContinueError(' ..Specify the setpoint and the sensor on the coil air outlet node when possible.')
END IF
ENDIF
CASE (iTemperatureAndHumidityRatio)
CALL CheckIfNodeSetpointManagedByEMS(SensorNodeNum,iTemperatureSetpoint, EMSSetpointErrorFlag)
IF (EMSSetpointErrorFlag) THEN
IF(.NOT. NodeHasSPMCtrlVarType(SensorNodeNum, iCtrlVarType_Temp)) THEN
CALL ShowWarningError(RoutineName//TRIM(WaterCoilType)//'="'//TRIM(WaterCoil(WhichCoil)%Name)//'". ')
CALL ShowContinueError(' ..Temperature setpoint not found on coil air outlet node.')
CALL ShowContinueError(' ..The setpoint may have been placed on a node downstream of the coil'// &
' or on an airloop outlet node.')
CALL ShowContinueError(' ..Specify the setpoint and the sensor on the coil air outlet node when possible.')
END IF
ENDIF
EMSSetpointErrorFlag = .FALSE.
CALL CheckIfNodeSetpointManagedByEMS(SensorNodeNum,iHumidityRatioMaxSetpoint, EMSSetpointErrorFlag)
IF (EMSSetpointErrorFlag) THEN
IF(.NOT. NodeHasSPMCtrlVarType(SensorNodeNum, iCtrlVarType_MaxHumRat)) THEN
CALL ShowWarningError(RoutineName//TRIM(WaterCoilType)//'="'//TRIM(WaterCoil(WhichCoil)%Name)//'". ')
CALL ShowContinueError(' ..Humidity ratio setpoint not found on coil air outlet node.')
CALL ShowContinueError(' ..The setpoint may have been placed on a node downstream of the coil'// &
' or on an airloop outlet node.')
CALL ShowContinueError(' ..Specify the setpoint and the sensor on the coil air outlet node when possible.')
END IF
ENDIF
END SELECT
ENDIF
ENDIF
RETURN
END SUBROUTINE CheckForSensorAndSetpointNode