SUBROUTINE LARCINHB( &
 ! --- INPUT ---------------------------------------------------------
 & KST,KPROF,KL0H,PDLOH,PCLOH,PCLOHSLD,PDLATH,PCLAH,PCLAHSLD, &
 & PDVERH,PVINTWH,PVINTWHSLD,PB1, &
 ! --- OUTPUT --------------------------------------------------------
 & PGWF)

! LARCINHB - semi-LAgrangian scheme (Interpolation)

! Purpose
! -------
!   LARCINHB - semi-Lagrangian scheme: origin point interpolations
!   for quantities situated at interface levels, i.e. vertical wind.
!   This subroutine is called only if LNHDYN=LGWADV=.TRUE. and LVFE_GW=F.

!   Abbreviation "vwv" stands for "vertical wind variable".

! Interface
! ---------
!   INPUT:
!     KST         - first elt of arrays where computations are performed.
!     KPROF       - depth of work.
!     KL0H        - index of the four western points
!                   of the 16 points interpolation grid.
!     PDLOH       - weights (distances) for horizontal interpolation
!                   on a same longitude.
!     PDLATH      - weight (distance) for horizontal interpolation
!                   on a same latitude.
!     PCLAH       - weights (distances) for horizontal cubic interpolation
!                   on a same latitude.
!     PDVERH      - weights (distances) for vertical linear interpolation
!                   on a same vertical.
!     PVINTWH     - Vertical cubic interpolation weights.
!     PB1         - "SLBUF1" buffer for interpolations.

!   OUTPUT:
!     PGWF        - Interpolated 3D quantity at O in the "gw" eqn.

! Externals
! ---------
!   LAITRE_GMV
!   LAITLI

! Method
! ------

! Reference
! ---------

! Author
! ------
!      Aug-2002 C. SMITH, based on subroutine LARCINB.

! Modifications
! -------------
!   01-Oct-2003 M. Hamrud  CY28 Cleaning!
!   10-Jun-2004 J. Masek   NH cleaning (LPC_NOTR)
!   19-Nov-2004 F. Vana    introducing splines and LAITRE_GMV
!   K. Yessad 07-03-2007: Remove useless (gw)_surf interpolations in NH+LGWADV.
!   28-Aug-2007 F. Vana    removing splines
!   30-Jun-2008 J. Masek   Dataflow for new SLHD interpolators.
!   K. Yessad Nov 2008: rationalisation of dummy argument interfaces
! End Modifications
!------------------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMDYNA  , ONLY : LSLHD_SVD
USE YOMDYN   , ONLY : NSVDLAG  ,LQMVD    ,LQMHVD
USE YOMMP    , ONLY : NASLB1
USE YOMDIM   , ONLY : NPROMA   ,NFLEVG   ,NFLSA    ,NFLEN
USE YOMSC2   , ONLY : NFLDSLB1
USE PTRSLB1  , ONLY : MSLB1VD9 ,MSLB1VD0
USE YOMHOOK   ,ONLY : LHOOK    ,DR_HOOK

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KST 
INTEGER(KIND=JPIM),INTENT(IN)    :: KPROF 
INTEGER(KIND=JPIM),INTENT(IN)    :: KL0H(NPROMA,0:NFLEVG-1,0:3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDLOH(NPROMA,0:NFLEVG-1,0:3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLOH(NPROMA,0:NFLEVG-1,3,2) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLOHSLD(NPROMA,0:NFLEVG-1,3,2)
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDLATH(NPROMA,0:NFLEVG-1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLAH(NPROMA,0:NFLEVG-1,3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLAHSLD(NPROMA,0:NFLEVG-1,3)
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDVERH(NPROMA,0:NFLEVG-1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVINTWH(NPROMA,0:NFLEVG-1,3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVINTWHSLD(NPROMA,0:NFLEVG-1,3)
REAL(KIND=JPRB)   ,INTENT(IN)    :: PB1(NASLB1,NFLDSLB1)
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PGWF(NPROMA,1:NFLEVG) 

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

REAL(KIND=JPRB) :: ZGWF(NPROMA,1:NFLEVG)
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "laitre_gmv.intfb.h"
#include "laitli.intfb.h"

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

IF (LHOOK) CALL DR_HOOK('LARCINHB',0,ZHOOK_HANDLE)

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

! 1. ORIGIN POINT INTERPOLATIONS.

! * Vertical divergence equation.
CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN, &
 & LSLHD_SVD,LQMVD,LQMHVD, &
 & KL0H(1,0,0),PDLOH,PCLOH,PCLOHSLD, &
 & PDLATH,PCLAH,PCLAHSLD,PVINTWH,PVINTWHSLD, &
 & PB1(1,MSLB1VD9),PGWF)

IF (NSVDLAG == 3) THEN
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
   & NFLEN,PDLATH,PDLOH(1,0,1),KL0H(1,0,1),PDVERH,&
   & PB1(1,MSLB1VD0),ZGWF)  
  PGWF(KST:KPROF,1:NFLEVG)= &
   & PGWF(KST:KPROF,1:NFLEVG)+ZGWF(KST:KPROF,1:NFLEVG)  
ENDIF

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

IF (LHOOK) CALL DR_HOOK('LARCINHB',1,ZHOOK_HANDLE)

END SUBROUTINE LARCINHB

