FUNCTION USTAR_0D(PWIND,PZ,PZ0,PLMO)
USE MODD_CSTS
USE MODD_SURF_PAR, ONLY : XUNDEF
IMPLICIT NONE
REAL, INTENT(IN) :: PWIND
REAL, INTENT(IN) :: PZ
REAL, INTENT(IN) :: PZ0
REAL, INTENT(IN) :: PLMO
REAL :: USTAR_0D
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!
!* purely unstable case
IF (LHOOK) CALL DR_HOOK('MODE_SBLS:USTAR_0D',0,ZHOOK_HANDLE)
USTAR_0D = 0.
!
!* general case
IF ( ABS(PLMO) >= 1.E-20 .AND. PLMO/=XUNDEF) &
USTAR_0D = PWIND * XKARMAN / ( LOG(PZ/PZ0) - PAULSON_PSIM(PZ/PLMO) + PAULSON_PSIM(PZ0/PLMO) )
!
!* purely neutral case
IF (PLMO==XUNDEF) &
USTAR_0D = PWIND * XKARMAN / LOG(PZ/PZ0)
IF (LHOOK) CALL DR_HOOK('MODE_SBLS:USTAR_0D',1,ZHOOK_HANDLE)
END FUNCTION USTAR_0D