Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | TDB | |||
real(kind=r64), | intent(in) | :: | H | |||
character(len=*), | intent(in), | optional | :: | calledfrom | ||
logical, | intent(in), | optional | :: | SuppressWarnings |
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.
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 PsyWFnTdbH(TDB,H,calledfrom, SuppressWarnings) RESULT(W)
! FUNCTION INFORMATION:
! AUTHOR George Shih
! DATE WRITTEN May 1976
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function provides the humidity ratio from dry-bulb temperature
! and enthalpy.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P100, EQN 32
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
REAL(r64), intent(in) :: TDB ! dry-bulb temperature {C}
REAL(r64), intent(in) :: H ! enthalpy {J/kg}
character(len=*), intent(in), optional :: calledfrom ! routine this function was called from (error messages)
LOGICAL, INTENT(IN), OPTIONAL :: SuppressWarnings ! if calling function is calculating an intermediate state
REAL(r64) :: W ! result=> humidity ratio
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
LOGICAL :: ReportWarnings
ReportWarnings = .TRUE.
IF (PRESENT(SuppressWarnings)) THEN
IF (SuppressWarnings) ReportWarnings = .FALSE.
ENDIF
!CP-------- here is 1.2, 1200., 1.004, or 1004. --------
W=(H-1.00484d3*TDB)/(2.50094d6+1.85895d3*TDB)
!
# 1864
! VALIDITY TEST.
IF (W < 0.0d0) THEN
IF (W < -.0001d0) THEN
IF (.not. WarmupFlag .AND. ReportWarnings) THEN
IF (iPsyErrIndex(iPsyWFnTdbH) == 0) THEN
String=' Dry-Bulb= '//TRIM(TrimSigDigits(TDB,2))//' Enthalpy= '//TRIM(TrimSigDigits(H,3))
CALL ShowWarningMessage('Calculated Humidity Ratio invalid (PsyWFnTdbH)')
if (present(calledfrom)) then
CALL ShowContinueErrorTimeStamp(' Routine='//trim(calledfrom)//',')
else
CALL ShowContinueErrorTimeStamp(' Routine=Unknown,')
endif
CALL ShowContinueError(TRIM(String))
String='Calculated Humidity Ratio= '//TRIM(TrimSigDigits(W,4))
CALL ShowContinueError(TRIM(String)//' ... Humidity Ratio set to .00001')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('Calculated Humidity Ratio invalid (PsyWFnTdbH)', &
iPsyErrIndex(iPsyWFnTdbH),ReportMinOf=W,ReportMaxOf=W,ReportMinUnits='[]',ReportMaxUnits='[]')
ENDIF
ENDIF
W=1.d-5
ENDIF
! W is the result
RETURN
END FUNCTION PsyWFnTdbH