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 | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | H | |||
real(kind=r64), | intent(in) | :: | RH | |||
real(kind=r64), | intent(in) | :: | PB |
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 TdbFnHRhPb(H,RH,PB) RESULT(T)
! FUNCTION INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN April 1, 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Given the specific enthalpy, relative humidity, and the
! barometric pressure, the function returns the dry bulb temperature.
! METHODOLOGY EMPLOYED:
! Inverts PsyHFnTdbRhPb
! REFERENCES:
! none
! USE STATEMENTS:
USE General, ONLY: SolveRegulaFalsi,RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
REAL(r64), intent(in) :: H ! specific enthalpy {J/kg}
REAL(r64), intent(in) :: RH ! relative humidity value (0.0-1.0)
REAL(r64), intent(in) :: PB ! barometric pressure {Pascals}
REAL(r64) :: T ! result=> humidity ratio
! FUNCTION PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: itmax =10
INTEGER, PARAMETER :: MaxIte = 500 ! Maximum number of iterations
REAL(r64), PARAMETER :: Acc = 1.0d0 ! Accuracy of result
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: SolFla ! Flag of solver
REAL(r64) :: T0 ! lower bound for Tprov [C]
REAL(r64) :: T1 ! upper bound for Tprov [C]
REAL(r64) :: Tprov =0.0d0 ! provisional value of drybulb temperature [C]
REAL(r64), DIMENSION(3) :: Par ! Par(1) = desired enthaply H [J/kg]
! Par(2) = desired relative humidity (0.0 - 1.0)
! Par(3) = barometric pressure [N/m2 (Pascals)]
T0 = 1.0d0
T1 = 50.0d0
Par(1) = H
Par(2) = Rh
Par(3) = Pb
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, Tprov, EnthalpyResidual, T0, T1, Par)
! if the numerical inversion failed, issue error messages.
IF (SolFla == -1) THEN
CALL ShowSevereError('Calculation of drybulb temperature failed in TdbFnHRhPb(H,RH,PB)')
CALL ShowContinueError(' Iteration limit exceeded')
CALL ShowContinueError(' H=['//trim(RoundSigDigits(H,6))//'], RH=['//trim(RoundSigDigits(RH,4))// &
'], PB=['//trim(RoundSigDigits(PB,5))//'].')
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Calculation of drybulb temperature failed in TdbFnHRhPb(H,RH,PB)')
CALL ShowContinueError(' Bad starting values for Tdb')
CALL ShowContinueError(' H=['//trim(RoundSigDigits(H,6))//'], RH=['//trim(RoundSigDigits(RH,4))// &
'], PB=['//trim(RoundSigDigits(PB,5))//'].')
END IF
IF (SolFla < 0) THEN
T = 0.0d0
ELSE
T = Tprov
END IF
RETURN
END FUNCTION TdbFnHRhPb