PSAT_1D Function

public function PSAT_1D(PT) result(PPSAT)

Arguments

Type IntentOptional AttributesName
real, intent(in), DIMENSION(:):: PT

Return Value real, DIMENSION(SIZE(PT))


Contents

Source Code


Source Code

      FUNCTION PSAT_1D(PT) RESULT(PPSAT)
!     ######################################
!-------------------------------------------------------------------------------
!
!*       0.    DECLARATIONS
!              ------------
!
USE MODD_CSTS
USE MODD_REPROD_OPER, ONLY : CQSAT
!
IMPLICIT NONE
!
!*       0.1   Declarations of arguments and results
!
!
REAL, DIMENSION(:), INTENT(IN)                :: PT     ! Temperature (Kelvin)
REAL, DIMENSION(SIZE(PT))                     :: PPSAT  ! saturation vapor pressure (Pa)
!
REAL, DIMENSION(SIZE(PT))  :: ZALP, ZBETA, ZGAM
!
INTEGER                         :: JJ !loop index
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!-------------------------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:PSAT_1D',0,ZHOOK_HANDLE)
!
!*       1.    COMPUTE SATURATION VAPOR PRESSURE
!              ---------------------------------
!
ZALP (:) = XALPW
ZBETA(:) = XBETAW
ZGAM (:) = XGAMW
!
IF(CQSAT=='NEW')THEN
 WHERE(PT<=XTT)
   ZALP  (:) = XALPI
   ZBETA (:) = XBETAI
   ZGAM  (:) = XGAMI 
 ENDWHERE
ENDIF
!
!cdir nodep
DO JJ=1,SIZE(PT)
  PPSAT(JJ) = EXP( ZALP(JJ) - ZBETA(JJ)/PT(JJ) - ZGAM(JJ)*LOG(PT(JJ)) )
ENDDO
!
!-------------------------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:PSAT_1D',1,ZHOOK_HANDLE)
!
END FUNCTION PSAT_1D