Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | TDP | |||
real(kind=r64), | intent(in) | :: | PB | |||
character(len=*), | intent(in), | optional | :: | calledfrom |
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 PsyWFnTdpPb(TDP,PB,calledfrom) 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 dew-point temperature
! and barometric pressure.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQN 22
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
REAL(r64), intent(in) :: TDP ! dew-point temperature {C}
REAL(r64), intent(in) :: PB ! barometric pressure {Pascals}
character(len=*), intent(in), optional :: calledfrom ! routine this function was called from (error messages)
REAL(r64) :: W ! result=> humidity ratio
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) PDEW ! saturation pressure at dew-point temperature {Pascals}
# 1773
IF (PRESENT(calledfrom)) THEN
PDEW=PsyPsatFnTemp(TDP,calledfrom)
ELSE
PDEW=PsyPsatFnTemp(TDP,'PsyWFnTdpPb')
ENDIF
W=PDEW*0.62198d0/(PB-PDEW)
! VALIDITY TEST.
IF (W < 0.0d0) THEN
IF (W <= -.0001d0) THEN
IF (.not. WarmupFlag) THEN
IF (iPsyErrIndex(iPsyWFnTdpPb) == 0) THEN
String=' Dew-Point= '//TRIM(TrimSigDigits(TDP,2))//' Pressure= '//TRIM(TrimSigDigits(PB,2))
CALL ShowWarningMessage('Calculated Humidity Ratio invalid (PsyWFnTdpPb)')
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('Entered Humidity Ratio invalid (PsyWFnTdpPb)', &
iPsyErrIndex(iPsyWFnTdpPb),ReportMinOf=W,ReportMaxOf=W,ReportMinUnits='[]',ReportMaxUnits='[]')
ENDIF
ENDIF
W=1.d-5
ENDIF
! W is the result
RETURN
END FUNCTION PsyWFnTdpPb