SUBROUTINE AER_SCAVBC &
 & ( KIDIA  , KFDIA  , KLON , KLEV  , KAER  , KSTEP ,&
 &   PFLRAIN, PFLSNOW, PAERO, PTAERI, PTSPHY, &
 &   PTAERO &
 & )

!*** * AER_SCAVBC* - BELOW-CLOUD SCAVENGING OF TRACERS

!**   INTERFACE.
!     ----------
!          *AER_SCAVBC* IS CALLED FROM *CALLPAR*.

!     AUTHOR.
!     -------
!        JEAN-JACQUES MORCRETTE  *ECMWF*
!        FROM O. BOUCHER (LOA, 1999-09) bc_scav

!     MODIFICATIONS.
!     --------------
!        ORIGINAL : 2004-05-07

!-----------------------------------------------------------------------
! INPUTS:
! -------
! PFLRAIN : liquid precipitation rate (kg m-2 s-1)
! PFLSNOW : solid precipitation rate  (kg m-2 s-1)
! PAERO   : aerosol amount             kg kg-1  
! PTAERI  : initial tendency accumulated from previous processes (kg kg-1)

! OUTPUTS:
!---------
! PTAERO : instantaneous tendency       kg kg-1 s-1

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

USE YOEAERSNK ,ONLY : R_R, R_S, RHO_WAT, RHO_ICE, RALPHAR, RALPHAS

USE YOMLUN   , ONLY : NULOUT
USE YOEDBUG  , ONLY : KSTPDBG, NSTPDBG

IMPLICIT NONE

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

!*       0.1  ARGUMENTS
!             ---------

INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA, KFDIA, KLON, KLEV, KAER, KSTEP

REAL(KIND=JPRB),INTENT(IN)    :: PTSPHY
REAL(KIND=JPRB),INTENT(IN)    :: PFLRAIN(KLON,KLEV+1), PFLSNOW(KLON,KLEV+1)
REAL(KIND=JPRB),INTENT(IN)    :: PAERO(KLON,KLEV), PTAERI(KLON,KLEV)

REAL(KIND=JPRB),INTENT(OUT)   :: PTAERO(KLON,KLEV)


!*       0.5   LOCAL VARIABLES
!              ---------------

INTEGER(KIND=JPIM) :: JK, JL
LOGICAL :: LLPRINT
REAL(KIND=JPRB) :: ZAERI(KLON,KLEV)

REAL(KIND=JPRB) :: ZALPHAR, ZALPHAS, ZINCR, ZPR, ZPS
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!-----------------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('AER_SCAVBC',0,ZHOOK_HANDLE)

ZALPHAR=RALPHAR(KAER)
ZALPHAS=RALPHAS(KAER)

LLPRINT=.FALSE.
!DO JL=1,NSTPDBG
!  IF (KSTEP == KSTPDBG(JL)) THEN
!    LLPRINT=.TRUE.
!  ENDIF
!ENDDO
IF (LLPRINT) THEN
  WRITE(NULOUT,'("AER_SCAVBC:",I3,6E12.5)') KAER,ZALPHAR,ZALPHAS,R_R,RHO_WAT,R_S,RHO_ICE
ENDIF

DO JK=1,KLEV
  DO JL=KIDIA,KFDIA
    ZAERI(JL,JK) = PAERO(JL,JK)

    ZPR = 0.5_JPRB*(PFLRAIN(JL,JK)+PFLRAIN(JL,JK+1))
    ZPS = 0.5_JPRB*(PFLSNOW(JL,JK)+PFLSNOW(JL,JK+1))
    ZINCR = 0.75_JPRB * (ZPR*ZALPHAR/R_R/RHO_WAT + ZPS*ZALPHAS/R_S/RHO_ICE)

    PTAERO(JL,JK) = PTAERI(JL,JK)-ZINCR * ZAERI(JL,JK)
  ENDDO
ENDDO

!-----------------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('AER_SCAVBC',1,ZHOOK_HANDLE)
END SUBROUTINE AER_SCAVBC

