FUNCTION DQSATW_O_DT_1D(PT,PP,PQSAT) RESULT(PDQSAT)
! ##############################################################
!
!!**** *QSATW * - function to compute saturation vapor humidity from
!! temperature
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute the saturation vapor
! pressure from temperature
!
!
!!** METHOD
!! ------
!! Given temperature T (PT), the saturation vapor pressure es(T)
!! (FOES(PT)) is computed by integration of the Clapeyron equation
!! from the triple point temperature Tt (XTT) and the saturation vapor
!! pressure of the triple point es(Tt) (XESTT), i.e
!!
!! es(T)= EXP( alphaw - betaw /T - gammaw Log(T) )
!!
!! with :
!! alphaw (XALPW) = LOG(es(Tt))+ betaw/Tt + gammaw Log(Tt)
!! betaw (XBETAW) = Lv(Tt)/Rv + gammaw Tt
!! gammaw (XGAMW) = (Cl -Cpv) /Rv
!!
!! Then, the specific humidity at saturation is deduced.
!!
!! Finally, dqsat / dT (T) is computed.
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! Module MODD_CST : comtains physical constants
!! XALPW : Constant for saturation vapor pressure function
!! XBETAW : Constant for saturation vapor pressure function
!! XGAMW : Constant for saturation vapor pressure function
!!
!! REFERENCE
!! ---------
!! Book2 of documentation of Meso-NH
!!
!!
!! AUTHOR
!! ------
!! V. Masson * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! Original 21/09/98
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_CSTS
!
IMPLICIT NONE
!
!* 0.1 Declarations of arguments and results
!
!
REAL, DIMENSION(:), INTENT(IN) :: PT ! Temperature
! (Kelvin)
REAL, DIMENSION(:), INTENT(IN) :: PP ! Pressure
! (Pa)
REAL, DIMENSION(:), INTENT(IN) :: PQSAT ! saturation vapor
! specific humidity
! with respect to
! water (kg/kg))
REAL, DIMENSION(SIZE(PT)) :: PDQSAT ! derivative according
! to temperature of
! saturation vapor
! specific humidity
! with respect to
! water (kg/kg))
!
!* 0.2 Declarations of local variables
!
REAL, DIMENSION(SIZE(PT)) :: ZFOES ! saturation vapor
! pressure
! (Pascal)
!
REAL :: ZWORK1
REAL, DIMENSION(SIZE(PT)) :: ZWORK2
!
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!-------------------------------------------------------------------------------
!
IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:DQSATW_O_DT_1D',0,ZHOOK_HANDLE)
!
!
!* 1. COMPUTE SATURATION VAPOR PRESSURE
! ---------------------------------
!
ZWORK1 = XRD/XRV
ZFOES (:) = PP(:) / (1.+ZWORK1*(1./PQSAT(:)-1.))
ZWORK2(:) = DPSAT(PT(:))
!
!* 2. DERIVATION ACCORDING TO TEMPERATURE
! -----------------------------------
!
PDQSAT(:) = ZWORK2(:) * PQSAT(:) / (1.+(ZWORK1-1.)*ZFOES(:)/PP(:) )
!
IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:DQSATW_O_DT_1D',1,ZHOOK_HANDLE)
!
!-------------------------------------------------------------------------------
!
END FUNCTION DQSATW_O_DT_1D