SUBROUTINE ROUSEA(KPROMA,KIDIA,KFDIA,PAPHI,PUB,PVB,PSLM,PAZO)

!**** *ROUSEA* - COMPUTATION OF THE MODIFIED ROUGHNESS LENGTHS
!                OVER SEA
!     PURPOSE
!     -------
!          COMPUTES THE ROUGHNESS LENGTH OVER SEA USING
!          AN APPROXIMATION OF THE CHARNOCK FORMULA
!          IN THE NEUTRAL CASE.

!**   INTERFACE
!     ---------
!     *CALL* ROUSEA(NMXLEN,1,MLNSET(KSET),NFLEVG,PAPHI5(1,NFLEVG),
!    I             PUF5(1,NFLEVG),PVF5(1,NFLEVG),PSLM5,
!    O             PZ05)

!        EXPLICIT ARGUMENTS
!        ------------------

!        KPROMA             - HORIZONTAL DIMENSION.                    (INPUT-C)
!        KIDIA              - INDEX OF START POINT                     (INPUT-C)
!        KFDIA              - INDEX OF END   POINT                     (INPUT-C)
!        PAPHI(KPROMA)      - GEOPOTENTIAL MODEL LEVELS     M**2/S**2  (INPUT)
!        PUB(KPROMA)        - U-WIND COMPONENT                 M/S     (INPUT)
!        PVB(KPROMA)        - V-WIND COMPONENT                 M/S     (INPUT)
!        PSLM(KPROMA)       - SEA LAND MASK                            (INPUT)
!        PAZO(KPROMA)       - ROUGHNESS LENGTH                  M      (INPUT)

!        IMPLICIT ARGUMENTS :  NONE.
!        --------------------

!     METHOD.
!     -------
!        SEE DOCUMENTATION

!     EXTERNALS.
!     ----------
!        NONE

!     REFERENCE.
!     ----------
!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS

!     AUTHOR.
!     -------
!        CARLA CARDINALI *ECMWF*

!        ORIGINAL   : 92-07-14
!        M. Hamrud  : 95-09-15  Some cleaning
!        L. Isaksen : 96-02-20  NFLEV --> NFLEVG
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

USE YOMCST   , ONLY : RG
USE YOEVDF   , ONLY : RKAP

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAPHI(KPROMA) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PUB(KPROMA) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVB(KPROMA) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PSLM(KPROMA) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PAZO(KPROMA) 
INTEGER(KIND=JPIM) :: JL

REAL(KIND=JPRB) :: ZA1, ZA2, ZA3, ZB2, ZB3, ZCDN, ZNLEV, ZWIN
REAL(KIND=JPRB) :: ZHOOK_HANDLE

!     1.     DEFINITION OF THE CONSTANTS
!            ---------------------------

!*    1.1    PHISICAL CONSTANTS

!*    1.2  *RKAP* IS THE VON KARMAN CONSTANT

!*    1.3     COMPUTATIONAL CONSTANTS.

IF (LHOOK) CALL DR_HOOK('ROUSEA',0,ZHOOK_HANDLE)
ZA1=0.756_JPRB/1000.0_JPRB
ZA2=0.60_JPRB/1000.0_JPRB
ZA3=0.79_JPRB/1000.0_JPRB
ZB2=0.052_JPRB/1000.0_JPRB
ZB3=0.0358_JPRB/1000.0_JPRB

!*         2.     COMPUTATION OF THE MODIFIED ROUGHNESS LENGTHS.
!                 ----------------------------------------------

DO JL=KIDIA,KFDIA
  IF(PSLM(JL) < 0.5_JPRB) THEN
    ZWIN=SQRT(PUB(JL)**2+PVB(JL)**2)
    ZNLEV=PAPHI(JL)/RG
    IF(ZWIN < 3.0_JPRB) THEN
      ZCDN=ZA1
    ELSEIF(ZWIN >= 3.0_JPRB.AND.ZWIN <= 11.7284_JPRB) THEN
      ZCDN=ZA2+ZB2*ZWIN
    ELSE
      ZCDN=ZA3+ZB3*ZWIN
    ENDIF
    PAZO(JL)=ZNLEV*EXP(-RKAP/SQRT(ZCDN))
  ENDIF
ENDDO

!     --------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('ROUSEA',1,ZHOOK_HANDLE)
END SUBROUTINE ROUSEA
