TD_FROM_TQ_0D Function

public function TD_FROM_TQ_0D(PT, PQ, PP) result(PTD)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: PT
real, intent(in) :: PQ
real, intent(in) :: PP

Return Value real


Contents

Source Code


Source Code

function TD_FROM_TQ_0D(PT, PQ, PP) RESULT(PTD)
!!    MODIFICATIONS
!!    -------------
!!       D.Meyer and R. Schoetter 2018: see a9c4c46889dca998ea9ca40e5e0edc62ecc75715
USE MODD_CSTS
USE MODD_SURF_PAR, ONLY: XUNDEF
!arguments and result
REAL, INTENT(IN) :: PT ! Air Temp. (K)
REAL, INTENT(IN) :: PQ ! Specific humidity (kg/kg)
REAL, INTENT(IN) :: PP ! Atmospheric pressure (Pa)
REAL :: PTD !Dew Point Air Temp. (K)
!local variables
REAL :: ALPHA
REAL :: ZPE !water vapour pressure
REAL(KIND=JPRB) :: ZHOOK_HANDLE

IF (LHOOK) CALL DR_HOOK('MODE_PSYCHRO:TD_FROM_TQ_0D',0,ZHOOK_HANDLE)
ZPE   = PE_FROM_PQ(PP,PQ)
ALPHA = LOG(ZPE/1000.)
IF ( (PT.GE.XTT).AND.(PT.LE.(93.+XTT)) ) THEN
        PTD = XTT+6.54+14.526*ALPHA+0.7389*ALPHA*ALPHA+0.09486*ALPHA**3 &
        +0.4569*(ZPE/1000.)**0.1984
ELSE IF (PT .LT. XTT) THEN
        PTD = XTT+6.09+12.608*ALPHA+0.4959*ALPHA*ALPHA
ELSE
        PTD = XUNDEF
ENDIF
PTD = MIN(PTD, PT)
IF (LHOOK) CALL DR_HOOK('MODE_PSYCHRO:TD_FROM_TQ_0D',1,ZHOOK_HANDLE)
end function TD_FROM_TQ_0D