Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | T | |||
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 PsyPsatFnTemp_raw(T,calledfrom) RESULT(Pascal)
# 2183
! FUNCTION INFORMATION:
! AUTHOR George Shih
! DATE WRITTEN May 1976
! MODIFIED NA
! RE-ENGINEERED Nov 2003; Rahul Chillar
! PURPOSE OF THIS FUNCTION:
! This function provides the saturation pressure as a function of temperature.
! METHODOLOGY EMPLOYED:
! Hyland & Wexler Formulation, range -100C to 200C
! REFERENCES:
! ASHRAE HANDBOOK OF FUNDAMENTALS, 2005, Chap 6 (Psychrometrics), Eqn 5 & 6.
! Compared to Table 3 values (August 2007) with average error of 0.00%, max .30%,
! min -.39%. (Spreadsheet available on request - Lawrie).
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
REAL(r64), intent(in) :: T ! dry-bulb temperature {C}
character(len=*), intent(in), optional :: calledfrom ! routine this function was called from (error messages)
REAL(r64) :: Pascal ! result=> saturation pressure {Pascals}
! FUNCTION PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: C1 = -5674.5359d0 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C2 = 6.3925247d0 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C3 = -0.9677843d-2 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C4 = 0.62215701d-6 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C5 = 0.20747825d-8 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C6 = -0.9484024d-12 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C7 = 4.1635019d0 ! Coefficient for TKel < KelvinConvK
REAL(r64), PARAMETER :: C8 = -5800.2206d0 ! Coefficient for TKel >= KelvinConvK
REAL(r64), PARAMETER :: C9 = 1.3914993d0 ! Coefficient for TKel >= KelvinConvK
REAL(r64), PARAMETER :: C10 = -0.048640239d0 ! Coefficient for TKel >= KelvinConvK
REAL(r64), PARAMETER :: C11 = 0.41764768d-4 ! Coefficient for TKel >= KelvinConvK
REAL(r64), PARAMETER :: C12 = -0.14452093d-7 ! Coefficient for TKel >= KelvinConvK
REAL(r64), PARAMETER :: C13 = 6.5459673d0 ! Coefficient for TKel >= KelvinConvK
# 2237
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: Tkel ! Dry-bulb in REAL(r64) for function passing
# 2253
# 2258
! CHECK T IN RANGE.
IF (T <= -100.0d0 .or. T >= 200.0d0) THEN
IF (.not. WarmupFlag) THEN
IF (iPsyErrIndex(iPsyPsatFnTemp) == 0) THEN
CALL ShowWarningMessage('Temperature out of range [-100. to 200.] (PsyPsatFnTemp)')
if (present(calledfrom)) then
CALL ShowContinueErrorTimeStamp(' Routine='//trim(calledfrom)//',')
else
CALL ShowContinueErrorTimeStamp(' Routine=Unknown,')
endif
CALL ShowContinueError(' Input Temperature='//TRIM(TrimSigDigits(T,2)))
ENDIF
CALL ShowRecurringWarningErrorAtEnd('Temperature out of range [-100. to 200.] (PsyPsatFnTemp)', &
iPsyErrIndex(iPsyPsatFnTemp),ReportMinOf=T,ReportMaxOf=T,ReportMinUnits='C',ReportMaxUnits='C')
ENDIF
ENDIF
! Convert temperature from Centigrade to Kelvin.
TKel = T + KelvinConv
! If below freezing, calculate saturation pressure over ice.
IF ((TKel .LT. KelvinConv) .AND. (TKel .GE. 173.15d0)) THEN
Pascal = EXP(C1/TKel+C2+TKel*(C3+TKel*(C4+TKel*(C5+C6*TKel)))+C7*LOG(TKel))
! If below -100C,set value of Pressure corresponding to Saturation Temperature of -100C.
ELSE IF ((TKel .Lt. 173.15d0)) THEN
Pascal = 0.0017d0
! If above freezing, calculate saturation pressure over liquid water.
ELSE IF ((TKel .GE. KelvinConv) .AND. (TKel .LE. 473.15d0)) THEN
Pascal = EXP(C8/TKel+C9+TKel*(C10+TKel*(C11+TKel*C12))+C13*LOG(TKel))
# 2302
! If above 200C, set value of Pressure corresponding to Saturation Temperature of 200C.
ELSE IF ((TKel .GT. 473.15d0)) THEN
Pascal = 1555000.0d0
ELSE
! bad temperature. Use 0.0 C
CALL ShowSevereError('PsyPsatFnTemp -- Bad input temperature='//TRIM(TrimSigDigits(T,2)))
if (present(calledfrom)) then
CALL ShowContinueErrorTimeStamp(' Routine='//trim(calledfrom)//',')
else
CALL ShowContinueErrorTimeStamp(' Routine=Unknown,')
endif
CALL ShowFatalError(' Program terminates due to preceding conditions.')
# 2319
ENDIF
RETURN
END FUNCTION PsyPsatFnTemp_raw