FUNCTION ENTH_FN_T_Q(PT,PQ) RESULT(PENTH)
! ######################################
!
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute the enthalpy function
! of temperature and humidity content
!
!
!!** METHOD
!! ------
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!!
!! REFERENCE
!! ---------
!!
!!
!!
!! AUTHOR
!! ------
!!
!!
!! MODIFICATIONS
!! -------------
!! Original 12/04/11
!! A. Alias 01/2013 compi. on Bull : must be 1.0E-5 instead of 1.0D-5
!! D.Meyer and R. Schoetter 2018: see a9c4c46889dca998ea9ca40e5e0edc62ecc75715
!
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_CSTS, ONLY: XTT
!
IMPLICIT NONE
!
!* 0.1 Declarations of arguments and results
!
!
REAL, INTENT(IN) :: PT ! Temperature (K)
REAL, INTENT(IN) :: PQ ! Humidity content (kg/kg)
REAL :: PENTH ! Enthalpy (J/kg)
!
!* 0.2 Declarations of local variables
!
REAL :: ZT ! Temperature (C)
REAL :: ZRV ! Mixing ratio (kg/kg_da)
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!
IF (LHOOK) CALL DR_HOOK('MODE_PSYCHRO:ENTH_FN_T_Q',0,ZHOOK_HANDLE)
!
ZT = PT - XTT
ZRV = PQ/(1.0-PQ)
!
IF (ZRV.LT.1.0E-5) ZRV = 1.0E-5
!
PENTH=1.00484E3*ZT+ZRV*(2.50094E6+1.85895E3*ZT)
!
IF (LHOOK) CALL DR_HOOK('MODE_PSYCHRO:ENTH_FN_T_Q',1,ZHOOK_HANDLE)
!-------------------------------------------------------------------------------
!
END FUNCTION ENTH_FN_T_Q