Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | TDB | |||
real(kind=r64), | intent(in) | :: | TWB | |||
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 PsyTdpFnTdbTwbPb(TDB,TWB,PB,calledfrom) RESULT(TDP)
! FUNCTION INFORMATION:
! AUTHOR George Shih
! DATE WRITTEN May 1976
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function calculates the dew-point temperature {C} from dry-bulb, wet-bulb and pressure.
! METHODOLOGY EMPLOYED:
! Needs description, as appropriate.
! REFERENCES:
! na
! USE STATEMENTS:
! na
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) :: TWB ! wet-bulb temperature {C}
REAL(r64), intent(in) :: PB ! barometric pressure (N/M**2) {Pascals}
character(len=*), intent(in), optional :: calledfrom ! routine this function was called from (error messages)
REAL(r64) :: TDP ! result=> dew-point temperature {C}
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) W ! humidity ratio
!
! calculate dew point temperature
W=PsyWFnTdbTwbPb(TDB,TWB,PB,calledfrom)
W=MAX(W,1.0d-5)
TDP=PsyTdpFnWPb(W,PB,calledfrom)
# 610
! VALIDITY TEST.
IF (TDP > TWB) THEN
IF (TDP > TWB+0.1d0) THEN
IF (.not. WarmupFlag) THEN ! Display error message
IF (iPsyErrIndex(iPsyTdpFnTdbTwbPb) == 0) THEN
CALL ShowWarningMessage('Calculated Dew Point Temperature being reset (PsyTdpFnTdbTwbPb)')
if (present(calledfrom)) then
CALL ShowContinueErrorTimeStamp(' Routine='//trim(calledfrom)//',')
else
CALL ShowContinueErrorTimeStamp(' Routine=Unknown,')
endif
String=' Dry-bulb='//TRIM(TrimSigDigits(TDB,2))//' Wet-Bulb (WB)= '//TRIM(TrimSigDigits(TWB,2))// &
' Pressure= '//TRIM(TrimSigDigits(PB,2))//' Humidity Ratio='//TRIM(TrimSigDigits(W,3))
CALL ShowContinueError(TRIM(String))
String=' Calculated Dew Point Temperature (DPT)= '//TRIM(TrimSigDigits(TDP,2))// &
'; Since DPT > WB, DPT will be set to WB'
Call ShowContinueError(TRIM(String))
ENDIF
CALL ShowRecurringWarningErrorAtEnd('Calculated Dew Point Temperature being reset (PsyTdpFnTdbTwbPb)', &
iPsyErrIndex(iPsyTdpFnTdbTwbPb),ReportMinOf=TDP,ReportMaxOf=TDP,ReportMinUnits='C',ReportMaxUnits='C')
ENDIF
TDP=TWB
ELSE
TDP=TWB
ENDIF
TDP=TWB
ENDIF
! TDP is the result
RETURN
END FUNCTION PsyTdpFnTdbTwbPb