#ifdef RS6K
@PROCESS NOCHECK
#endif
SUBROUTINE LARCINB( &
 ! --- INPUT ----------------------------------------------------------
 & KST,KPROF,KHVI,LDSLPHY,LD2TLFF1,&
 & KL0,KLH0,PDLO,PCLO,PCLOSLD,&
 & PDLAT,PCLA,PCLASLD,KLEV,PDVER,PVINTW,PVINTWSLD,PVINTWS,PVDERW,PHVW,PB1,&
 ! --- INPUT/OUTPUT --------------------------------------------------
 & KVSEPC,KVSEPL,&
 ! --- OUTPUT --------------------------------------------------------
 & PDP,&
 & PUF,PVF,PTF,&
 & PGFLF,PCF,PCF_SI,PSVDF,PNHXF,PSPDF,PYF,&
 & PRSAF,&
 & PUFZ,PVFZ,&
 & PUPF,PVPF,PTPF,PGFLPF,&
 & PDBBCF,PDPHIF,PGWSF,&
 & PUF_SI,PVF_SI,PTF_SI,PSVDF_SI,PSPDF_SI)

!**** *LARCINB    -  semi-LAgrangian scheme:(Interpolation)

!     Purpose.
!     --------
!       Does the interpolations necessary in the semi-Lagrangian scheme.

!**   Interface.
!     ----------
!        *CALL* *LARCINB(......)

!        Explicit arguments :
!        --------------------

!        INPUT:
!          KST         - first element of arrays where
!                        computations are performed.
!          KPROF       - depth of work.
!          KHVI        - 1/0: Cubic Hermite vert. interp. are needed/not needed
!          LDSLPHY     - split physics in semi lagrangian mode.
!          LD2TLFF1    - .T./.F.: Refined treatement of (2*Omega Vec r) at
!                        the origin point when there is t-dt (or t in SL2TL)
!                        physics / Other cases.
!          KL0         - index of the four western points
!                        of the 16 points interpolation grid.
!          KLH0        - second value of index of the four western points
!                        of the 16 points interpolation grid if needed.
!          PDLO        - distances for horizontal linear interpolations
!                        in longitude (latitude rows 0, 1, 2, 3)
!          PCLO        - weights for horizontal cubic interpolations in
!                        longitude (latitude rows 1, 2)
!          PCLOSLD     - weights for horizontal cubic interpolations in
!                        longitude, SLHD case (latitude rows 1, 2)
!          PDLAT       - distance for horizontal linear interpolations
!                        in latitude
!          PCLA        - weights for horizontal cubic interpolations
!                        in latitude
!          PCLASLD     - weights for horizontal cubic interpolations
!                        in latitude, SLHD case
!          KLEV        - lower level of the vertical interpolation
!                        grid needed for vertical interpolations
!          PDVER       - distance for vertical linear interpolation
!          PVINTW      - vertical cubic interpolation weights
!          PVINTWSLD   - vertical cubic interpolation weights, SLHD case
!          PVINTWS     - vertical spline interpolation weights
!          PVDERW      - weights to compute vertical derivatives necessary for
!                        Hermite cubic vertical interpolation.
!          PHVW        - Hermite vertical cubic interpolation weights.
!          PB1         - "SLBUF1" buffer for interpolations.

!        INPUT/OUTPUT:
!          KVSEPC      - vertical separation (used in SL adj, cubic interp)
!          KVSEPL      - vertical separation (used in SL adj, linear interp)

!        OUTPUT:
!          PDP         - Interpolated 2D term at O for continuity equation.
!          PUF         - Interpolated quantity at O in the U-wind eqn.
!          PVF         - Interpolated quantity at O in the V-wind eqn.
!          PTF         - Interpolated quantity at O in the temperature eqn.
!          PGFLF       - Interpolated quantity at O in the 
!                        unified_treatment grid-point fields
!          PCF         - Interpolated 3D quantity at O in the cont. eqn.
!          PCF_SI      - Interpolated 3D quantity at O in the cont. eqn (SI).
!          PSVDF       - Interpolated 3D quantity at O in vert.div. eqn.
!          PNHXF       - Interpolated 3D quantity at O in "X" equation
!                        (if NVDVAR=4).
!          PSPDF       - Interpolated 3D quantity at O in pressure dep. eqn.
!          PYF         - Interpolated 3D quantity at O in the Y-term.
!          PRSAF       - Interpolated "rs/a" or "r/a" at O.
!          PUFZ and PVFZ for SL2TL scheme:
!          PUFZ        - Interpolated U-wind at O for L2TLFF=.T. option.
!          PVFZ        - Interpolated V-wind at O for L2TLFF=.T. option.
!          PUPF        - Interpolated quantity at O in U-wind eqn
!                        for split physics (if LDSLPHY=.T. only).
!          PVPF        - Interpolated quantity at O in V-wind eqn
!                        for split physics (if LDSLPHY=.T. only).
!          PTPF        - Interpolated quantity at O in T eqn
!                        for split physics (if LDSLPHY=.T. only).
!          PGFLPF      - Interpolated quantity at O in 
!                        unified_treatment grid-point fields.
!          PDBBCF      - interpolated (dgw_s/dt)/(pressure depth)_L at O.
!          PDPHIF      - interpolated (p/mRT)_L at O.
!          PGWSF       - interpolated (gw_s) at O(L).
!          PUF_SI to PSPDF_SI: interpolated separate linear terms at O.

!        Implicit arguments :
!        --------------------

!     Method.
!     -------
!        See documentation

!     Externals.
!     ----------

!        Called by LAPINEB.
!        Calls LAITLI,LAIDDI,
!              LAITRE_GMV,LAITRE_GFL

!     Reference.
!     ----------

!     Author.
!     -------
!        K. YESSAD, after the subroutine LAGINT0 written by Maurice IMBARD
!        Alain CRAPLET and Michel ROCHAS  METEO FRANCE/EERM/CRMD

! Modifications
! -------------
!   Original : JUNE 1991.
!   Modifications:
!   K. YESSAD (METEO-FRANCE CNRM/GMAP): 21/11/1991.
!   K. YESSAD: February 1992 (optimisation, consistency with IO scheme).
!   M. HORTAL (ECMWF) and K. YESSAD (CNRM/GMAP): 04/11/1992.
!          (possible use of an irregularly spaced vertical coordinate).
!   K. YESSAD: December 1992 (non interpolating vertical scheme).
!   Modified 93-12-14 by K. YESSAD: interpolations at medium point for
!                                 semi-lagrangian temperature equation.
!   Modified 93-12-21 by C. Temperton: interpolations at medium point for
!                                 semi-lagrangian moisture equation.
!   Modified 93-02-15 by K. YESSAD: replacing switch KWIS by KWISA and KXLAG.
!   Modified 94-03-23 by M. Hortal: interpolations at medium point for
!                                 semi-lagrangian momentum equations
!   Modified 94-09-30 by M. Hortal: Quasi-monotone interpolations
!   Modified 94-10-17 by M. Tolstykh: CUD-5 interpolation
!   Modified JAN 1995 by M. Tolstykh and K. YESSAD:
!          - CUD-5 interpolation for vertical interpolating scheme.
!          - CUD-5 interpolation for liquid water, ice and cloudiness.
!          - CUD-5 interpolation for options NVLAG=3, NWLAG=3, NTLAG=3.
!          - Merge of routines LAICDN and LAICDSW into LAICDD for
!            horizontal CUD-5 interpolations.
!          - Harmonisation of conventions (notations, numbering of
!            latitudes) in CUD-5 interpolations with 12 or 32 points
!            interpolations routines.
!          - Introduction of array PCUDWM for optimisations of CUD-5
!            meridian derivatives.
!          - Simplification of treatment of NVLAG=2 formulation of
!            2D shallow-water continuity equation.
!          - Remove of useless quantity KBFLDOP.
!   Modified 95-01-17 by R. Bubnova:
!          - Plane geometry after developments of M. Janousek.
!   Modified by K. YESSAD (AUGUST 1995):
!          - Accurate two-time level SL scheme (after Tolstykh/Janousek).
!          - Second-order decentering in two-time level SL scheme.
!          - DO loops updated according to F90 norms.
!   Modified 95-10-01 by MPP Group *ECMWF* Distributed memory version
!   K. YESSAD (MARCH 1996):
!        - ZLON, ZLAT become dummy arguments PLON, PLAT.
!   Modified 96-06-03 by M. Janousek and R. Bubnova:
!          - non-hydrostatic dynamics and LCORAN option in plane geom.
!   Modified 96-03 by A. Untch : grid-point prognostic ozone
!   Modified 96-04-17 by C. Temperton:
!     - Refined treatment of Coriolis term in 2TL scheme
!   Modified by K. YESSAD (AUGUST 1996):
!          - Hermite cubic vertical interpolations for passive scalars.
!            Not yet coded for plane geometry.
!            Not yet coded for CUD-5 scheme.
!   Modified 97-05-14 by C. Temperton:
!          - Options NVLAG=3 and NWLAG=3 added to SWE model
!   Modified 97-05-19 by C. Temperton:
!          - Strange quasi-monotone options removed from SWE model
!          - and add switch for linear/cubic interp. to find trajectory.
!   Modified 98-01-19 by C. Temperton:
!            2D (SWE) options removed and transferred to LARCIN2
!   Modified 98-09-01 by N. Wedi:
!            split physics in semi-lagrangian mode
!   Modified 98-03-20 by K. YESSAD: bug corrections.
!   Modified 98-05-07 by K. YESSAD: adaptation of L2TLFF to LAGPHY=.F..
!   Modified July 1998 by K. YESSAD: cleaning
!          - removal of options NODEC=2, L2TLAW=T, L2TLAT=T
!          - complete declaration of dummy arguments.
!          - correction of false comments.
!          - improvement of code readability (indentation and numbering
!            of comments for ex.).
!   Modified 98-05-27 by E. Holm: 
!          - Changed order of ozone in call and inside routine.
!   Modified 99-11-16 by C. Temperton: added KWISA(2)=4 option.
!   Modified 99-03-31 by P. SMOLIKOVA: option LRDAORG (double averaging).
!   Modified 99-09-21 by D.SALMOND: On Demand Semi-Lagrangian Comms
!   Modified 00-02-07 by C. Temperton: removed redundant use of PX0
!                                      when NVLAG=3.
!   Modified 00-02-11 by C. Temperton: added computation of KVSEP
!   Modified 00-06-15 by C. Temperton: KVSEP -> KVSEPC,KVSEPL.
!                                      (and logic corrected!)
!   Modified NOV 1999 by K. YESSAD:
!    - in 'lacudw', compute PDLAT and ILA as in 'lascaw' =>
!      'krlatx', 'kindlat' and 'pdllat' become useless.
!   K. YESSAD (Nov 1999): cleaning
!    - recode SL3TL like SL2TL and eliminate useless interpolations
!      in continuity equation.
!   Modified 99-12-22 by C. Fischer: clean out call to elacudw
!   Modified April 2000 by Malgorzata Szczech:
!    - bug corrections for thermodynamical ozon.
!    - add option "lhvo3" for thermodynamical ozon.
!   Modified August 2000 by Deborah Salmond to split into _traj and _int
!   Modified 00-11-23 by C. Temperton: renamed _TRAJ and _INT routines.
!   Modified 01-06-26 by K. YESSAD:
!    - cleanings (remove useless variables),
!      update or correct some comments, especially in the context of the
!      introduction of thin layer hypothesis relaxation ("(a/rs)*winds"
!      are interpolated and no longer winds if lvercor=true).
!    - Relaxation of thin layer hypothesis.
!    - Restore options using Hermite vertical interpolations.
!   Modified 01-08-30 by K. YESSAD: pruning and some other cleanings.
!   D.Salmond (15-10-01) FULLIMP mods
!   J.Vivoda 03-2002 PC schemes for NH dynamics (LPC_XXXX keys)
!   Modified 02-09-30 by P. Smolikova : variable d4 in NH
!   J.Vivoda 03-2002 PC schemes for NH dynamics (LPC_XXXX keys)
!   Modified 08-2002 C. Smith : use "w" as prognostic variable in the
!    semi-lag advection of vertical divergence in the NH model.
!   Modified 2003-03-16 M.Hamrud/M.Hortal - Revised data flow (GFL)
!   Modified 2003-08-19 by F. Vana: SL diffusion.
!   01-Oct-2003 M. Hamrud  CY28 Cleaning
!   D.Salmond     22-Dec-2003 Karim's Larcin cleaning
!   09-Jun-2004 J. Masek   NH cleaning (LPC_NOTR, LFULLIMP)
!   01-Jul-2004 K. Yessad  Make clearer the tests for PC scheme.
!   07-Jul-2004 K. Yessad  LSLHD with monotonic interpolations.
!   19-Nov-2004 F. Vana    introducing LAITRE_GMV and LAITRE_GFL
!   14-Feb-2005 F. Vana    - Split of the global LSLHD key.
!                          - 2D spline interpolations.
!   28-Aug-2007 F. Vana  removing the 4-points splines.
!   N. Wedi and K. Yessad (Jan 2008): different dev for NH model and PC scheme
!   30-Jun-2008 J. Masek   Dataflow for new SLHD interpolators.
!   17-Sep-2008 F. Vana  updating arguments for LAITRE_GFL
!   K. Yessad Nov 2008: rationalisation of dummy argument interfaces
!   K. Yessad Nov 2008: interpolation routines: merge QM with not-QM version.
! End Modifications
!------------------------------------------------------------------------------

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

USE YOMCT0   , ONLY : LNHDYN   ,LVERCOR  ,LPC_OLD
USE YOMCVER  , ONLY : LVFE_GW
USE YOMDIM   , ONLY : NFLEVG   ,NPROMA   ,NFLSA    ,NFLEN
USE YOMDYNA  , ONLY : LGWADV   ,LRDBBC   ,NVDVAR   ,LNH_PDVD ,LNH_GEOGW,&
 & LSLHD_W  ,LSLHD_T  ,LSLHD_SPD,LSLHD_SVD,LRWSDLW  ,LRWSDLR  ,ND4SYS
USE YOM_YGFL , ONLY : YGFL     ,YGFLC
USE YOMDYN   , ONLY : NSITER   ,LSLINLC1 ,LSLINLC2 ,LSLINL   ,NCURRENT_ITER,&
 & LADVFW   ,NVLAG    ,NWLAG    ,NTLAG    ,NSPDLAG  ,NSVDLAG  ,&
 & LQMW     ,LQMHW    ,LQMT     ,LQMHT    ,LQMP     ,LQMHP    ,&
 & LQMPD    ,LQMHPD   ,LQMVD    ,LQMHVD
USE YOMMP    , ONLY : NASLB1
USE YOMSC2   , ONLY : NFLDSLB1
USE YOMSEP   , ONLY : LFINDVSEP
USE PTRSLB1  , ONLY : MSLB1U9  ,MSLB1V9  ,MSLB1T9  ,MSLB1GFL9,MSLB1GFLSP9,&
 & MSLB1PD9 ,MSLB1VD9 ,MSLB1Y9  ,MSLB1UR9 ,MSLB1VR9 ,MSLB1U0  ,&
 & MSLB1V0  ,MSLB1T0  ,MSLB1PD0 ,MSLB1VD0 ,MSLB1C9  ,MSLB1C9_SI,MSLB1SP9 ,&
 & MSLB1UP9 ,MSLB1VP9 ,MSLB1TP9 ,MSLB1GFLP9,MSLB1RSSA9,&
 & MSLB1GWS9,MSLB1DPHI9,MSLB1DBBC9,MSLB1NHX9,&
 & MSLB1U9_SI,MSLB1V9_SI,MSLB1T9_SI,MSLB1VD9_SI,MSLB1PD9_SI

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KHVI 
INTEGER(KIND=JPIM),INTENT(IN)    :: KST 
INTEGER(KIND=JPIM),INTENT(IN)    :: KPROF 
LOGICAL           ,INTENT(IN)    :: LDSLPHY 
LOGICAL           ,INTENT(IN)    :: LD2TLFF1 
INTEGER(KIND=JPIM),INTENT(IN)    :: KL0(NPROMA,NFLEVG,0:3) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KLH0(NPROMA,NFLEVG,0:3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDLO(NPROMA,NFLEVG,0:3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLO(NPROMA,NFLEVG,3,2)
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLOSLD(NPROMA,NFLEVG,3,2)
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDLAT(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLA(NPROMA,NFLEVG,3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLASLD(NPROMA,NFLEVG,3) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PDVER(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVINTW(NPROMA,NFLEVG,3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVINTWSLD(NPROMA,NFLEVG,3) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVINTWS(NPROMA,NFLEVG,1:4) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVDERW(NPROMA,NFLEVG,2*KHVI,2*KHVI) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PHVW(NPROMA,NFLEVG,4*KHVI) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PB1(NASLB1,NFLDSLB1)
INTEGER(KIND=JPIM),INTENT(INOUT) :: KVSEPC 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KVSEPL 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PDP(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PUF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PVF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PGFLF(NPROMA,NFLEVG,YGFL%NUMFLDS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PCF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PCF_SI(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSVDF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PNHXF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSPDF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PYF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PRSAF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PUFZ(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PVFZ(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PUPF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PVPF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTPF(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PGFLPF(NPROMA,NFLEVG,YGFL%NUMFLDS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PDBBCF(NPROMA) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PDPHIF(NPROMA) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PGWSF(NPROMA) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PUF_SI(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PVF_SI(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTF_SI(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSVDF_SI(NPROMA,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSPDF_SI(NPROMA,NFLEVG) 

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

INTEGER(KIND=JPIM) :: ISEP (NPROMA)
REAL(KIND=JPRB) :: ZUF     (NPROMA,NFLEVG)
REAL(KIND=JPRB) :: ZVF     (NPROMA,NFLEVG)
REAL(KIND=JPRB) :: ZTF     (NPROMA,NFLEVG)
REAL(KIND=JPRB),ALLOCATABLE :: ZNHF(:,:)

INTEGER(KIND=JPIM) :: JLEV, JROF, IMINSEP, IVSEP, JGFL  

LOGICAL :: LLDONE
LOGICAL :: LLNOSLHD
LOGICAL :: LL1,LL2,LL3

REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "abor1.intfb.h"
#include "laiddi.intfb.h"
#include "laitli.intfb.h"
#include "laitre_gmv.intfb.h"
#include "laitre_gfl.intfb.h"

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

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

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

!*       1.    PRELIMINARY INITIALISATIONS + ALLOCATIONS.
!              ------------------------------------------

! * switch for GMV fields where SLHD is not applied
LLNOSLHD=.FALSE.

! * calculation of KVSEPC and KVSEPL:
IF (LFINDVSEP) THEN

  IVSEP=KVSEPC-1
  LLDONE=.FALSE.
  DO WHILE (.NOT.LLDONE)
    IVSEP=IVSEP+1
    DO JROF=KST,KPROF
      ISEP(JROF)=KLEV(JROF,IVSEP+1)-KLEV(JROF,1)
    ENDDO
    DO JLEV=2,NFLEVG-IVSEP
      DO JROF=KST,KPROF
        ISEP(JROF)=MIN(ISEP(JROF),(KLEV(JROF,JLEV+IVSEP)-KLEV(JROF,JLEV)))
      ENDDO
    ENDDO
    IMINSEP=NFLEVG
    DO JROF=KST,KPROF
      IMINSEP=MIN(IMINSEP,ISEP(JROF))
    ENDDO
    LLDONE = IMINSEP >= 4 .OR. IVSEP == NFLEVG-1
  ENDDO
  IF (IMINSEP < 4) THEN
    CALL ABOR1('LARCINB: UNABLE TO COMPUTE NVSEPC')
  ENDIF
  KVSEPC=MAX(KVSEPC,IVSEP)

  IVSEP=KVSEPL-1
  LLDONE=.FALSE.
  DO WHILE (.NOT.LLDONE)
    IVSEP=IVSEP+1
    DO JROF=KST,KPROF
      ISEP(JROF)=KLEV(JROF,IVSEP+1)-KLEV(JROF,1)
    ENDDO
    DO JLEV=2,NFLEVG-IVSEP
      DO JROF=KST,KPROF
        ISEP(JROF)=MIN(ISEP(JROF),(KLEV(JROF,JLEV+IVSEP)-KLEV(JROF,JLEV)))
      ENDDO
    ENDDO
    IMINSEP=NFLEVG
    DO JROF=KST,KPROF
      IMINSEP=MIN(IMINSEP,ISEP(JROF))
    ENDDO
    LLDONE = IMINSEP >= 2 .OR. IVSEP == NFLEVG-1
  ENDDO
  IF (IMINSEP < 2) THEN
    CALL ABOR1('LARCINB: UNABLE TO COMPUTE NVSEPL')
  ENDIF
  KVSEPL=MAX(KVSEPL,IVSEP)

ENDIF

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

!*       2.    ORIGIN POINT INTERPOLATIONS FOR GMV VARIABLES.
!              ----------------------------------------------

! * Allocation:
IF (LNHDYN) ALLOCATE (ZNHF(NPROMA,NFLEVG))

! * U-Momentum equation:

! --- part of the RHS requiring a "high order" interpolation:
CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
 & LSLHD_W,LQMW,LQMHW,&
 & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
 & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
 & PB1(1,MSLB1U9),PUF)

IF(NWLAG == 3) THEN

  ! --- save U in some cases:
  IF (LD2TLFF1) THEN
    ! Interpolate U at the origin point and use PUFZ
    ! to store the interpolated quantities.
    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
     & LSLHD_W,LQMW,LQMHW,&
     & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
     & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
     & PB1(1,MSLB1UR9),PUFZ)
  ELSE
    ! Save PUF in case of refined treatment of
    ! Coriolis term and lagged physics in 2TL scheme:
    PUFZ(KST:KPROF,1:NFLEVG)=PUF(KST:KPROF,1:NFLEVG)
  ENDIF

  ! --- part of the RHS requiring a trilinear interpolation:
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
   & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
   & PB1(1,MSLB1U0),ZUF)  
  DO JLEV=1,NFLEVG
    DO JROF=KST,KPROF
      PUF(JROF,JLEV)=PUF(JROF,JLEV) +ZUF(JROF,JLEV)
    ENDDO
  ENDDO

  IF (LSLINL .AND. NCURRENT_ITER == 0) THEN
    ! Linear terms interpolated separately when required.
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1U9_SI),PUF_SI)  
  ENDIF

  ! --- Split physics requiring a trilinear interpolation:
  IF(LDSLPHY) THEN
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1UP9),PUPF)                
  ENDIF

ENDIF
   
! * V-Momentum equation:

! --- part of the RHS requiring a "high order" interpolation:
CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
 & LSLHD_W,LQMW,LQMHW,&
 & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
 & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
 & PB1(1,MSLB1V9),PVF)

IF(NWLAG == 3) THEN

  ! --- save V in some cases:
  IF (LD2TLFF1) THEN
    ! Interpolate V at the origin point and use PVFZ
    ! to store the interpolated quantities.
    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
     & LSLHD_W,LQMW,LQMHW,&
     & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
     & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
     & PB1(1,MSLB1VR9),PVFZ)

  ELSE
    ! Save PVF in case of refined treatment of
    ! Coriolis term and lagged physics in 2TL scheme:
    PVFZ(KST:KPROF,1:NFLEVG)=PVF(KST:KPROF,1:NFLEVG)
  ENDIF

  ! --- part of the RHS requiring a trilinear interpolation:
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
   & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
   & PB1(1,MSLB1V0),ZVF)  
  DO JLEV=1,NFLEVG
    DO JROF=KST,KPROF
      PVF(JROF,JLEV)=PVF(JROF,JLEV) +ZVF(JROF,JLEV)
    ENDDO
  ENDDO

  IF (LSLINL .AND. NCURRENT_ITER == 0) THEN
    ! Linear terms interpolated separately when required.
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1V9_SI),PVF_SI)  
  ENDIF

  ! --- Split physics requiring a trilinear interpolation:
  IF(LDSLPHY) THEN
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1VP9),PVPF)                
  ENDIF

ENDIF

! * Temperature equation:

! --- part of the RHS requiring a "high order" interpolation:
CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
 & LSLHD_T,LQMT,LQMHT,&
 & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
 & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
 & PB1(1,MSLB1T9),PTF)

IF(NTLAG == 3) THEN

  ! --- part of the RHS requiring a trilinear interpolation:
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
   & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
   & PB1(1,MSLB1T0),ZTF)  
  DO JLEV=1,NFLEVG
    DO JROF=KST,KPROF
      PTF(JROF,JLEV)=PTF(JROF,JLEV) + ZTF(JROF,JLEV)
    ENDDO
  ENDDO

  IF (LSLINL .AND. NCURRENT_ITER == 0) THEN
    ! Linear terms interpolated separately when required.
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1T9_SI),PTF_SI)  
  ENDIF

  ! --- Split physics requiring a trilinear interpolation:
  IF(LDSLPHY) THEN
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1TP9),PTPF)  
  ENDIF

ENDIF

! * Pressure departure variable equation (NH model):

IF (LNHDYN) THEN

  ! --- part of the RHS requiring a "high order" interpolation:
  CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
   & LSLHD_SPD,LQMPD,LQMHPD,&
   & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
   & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
   & PB1(1,MSLB1PD9),PSPDF)

  IF(NSPDLAG == 3) THEN

    ! --- part of the RHS requiring a trilinear interpolation:
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
     & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1PD0),ZNHF)  
    DO JLEV=1,NFLEVG
      DO JROF=KST,KPROF
        PSPDF(JROF,JLEV)=PSPDF(JROF,JLEV)+ZNHF(JROF,JLEV)
      ENDDO
    ENDDO

    IF (LSLINL .AND. NCURRENT_ITER == 0) THEN
      ! Linear terms interpolated separately when required.
      CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
       & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
       & PB1(1,MSLB1PD9_SI),PSPDF_SI)  
    ENDIF

  ENDIF

ENDIF

! * Vertical divergence equation (NH model):
!   Valid for:
!   - LNH_PDVD=T: case LGWADV=F.
!   - LNH_PDVD=T: case (LGWADV,LVFE_GW)=T,T.
!   - LNH_GEOGW=T: case LVERTFE=T.

IF (LNHDYN) THEN

  LL1=LNH_PDVD.AND.(.NOT.LGWADV)
  LL2=LNH_PDVD.AND.LGWADV.AND.LVFE_GW
  LL3=LNH_PDVD.AND.LGWADV.AND.(ND4SYS == 2).AND.(NCURRENT_ITER < NSITER)

  ! --- part of the RHS requiring a "high order" interpolation:
  IF (LL1.OR.LL2.OR.LNH_GEOGW) THEN
    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
     & LSLHD_SVD,LQMVD,LQMHVD,&
     & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
     & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
     & PB1(1,MSLB1VD9),PSVDF)
  ENDIF

  ! --- "X" variable requiring a "high order" interpolation,
  !     present only if NVDVAR=4 (the SLHD interpolation is never
  !     applied to this quantity):
  IF ((LL1.OR.LL3).AND.(NVDVAR == 4)) THEN
    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
     & LLNOSLHD,LQMVD,LQMHVD,&
     & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
     & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
     & PB1(1,MSLB1NHX9),PNHXF)
  ENDIF

  IF(NSVDLAG == 3) THEN

    ! --- part of the RHS requiring a trilinear interpolation:
    IF(LL1.OR.LL2.OR.LNH_GEOGW) THEN
      CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
       & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
       & PB1(1,MSLB1VD0),ZNHF)  
      DO JLEV=1,NFLEVG
        DO JROF=KST,KPROF
          PSVDF(JROF,JLEV)=PSVDF(JROF,JLEV)+ZNHF(JROF,JLEV)
        ENDDO
      ENDDO
    ENDIF

    IF (LSLINL .AND. NCURRENT_ITER == 0) THEN
      ! Linear terms interpolated separately when required.
      CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
       & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
       & PB1(1,MSLB1VD9_SI),PSVDF_SI)  
    ENDIF

  ENDIF

ENDIF

! * Deallocation:
IF (ALLOCATED(ZNHF)) DEALLOCATE(ZNHF)

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

!*       3.    ORIGIN POINT INTERPOLATIONS FOR GFL VARIABLES.
!              ----------------------------------------------

! * The interpolations are tri-dimensional ones.

DO JGFL=1,YGFL%NUMFLDS
  IF(YGFLC(JGFL)%LADV) THEN
      
    ! --- part of the RHS requiring a "high order" interpolation:
    CALL LAITRE_GFL(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,KHVI, &
     & YGFLC(JGFL)%CSLINT, &
     & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
     & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD,PVINTWS, &
     & PVDERW,PHVW, &
     & PB1(1,MSLB1GFL9+(YGFLC(JGFL)%MP_SL1-1)*(NFLEN-NFLSA+1)), &
     & PB1(1,MSLB1GFLSP9+(YGFLC(JGFL)%MP_SPL-1)*(NFLEN-NFLSA+1)), &
     & PGFLF(1,1,JGFL))

    ! --- Split physics requiring a trilinear interpolation:
    IF(LDSLPHY) THEN
      ! The numbering of GFL fields in PGFLSLP should be consistent with
      !  what is done in GPADDSLPHY and SUSLB.
      ! For the time being fields in interpolation buffer are counted even
      !  if they are useless.
      CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
       & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
       & PB1(1,MSLB1GFLP9+(JGFL-1)*(NFLEN-NFLSA+1)),PGFLPF(1,1,JGFL))  
    ENDIF

  ENDIF
ENDDO

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

!*       4.    ORIGIN POINT INTERPOLATIONS FOR GMVS VARIABLES.
!              -----------------------------------------------

! * The interpolations are tri-dimensional and 2D ones.
!   Remark: 
!   The available 2D "high order" interpolator is LAIDDI.
!   The SLHD interpolator is never applied to continuity equation.

! * Continuity equation:

! --- 3D part of the RHS requiring a "high order" interpolation:
IF(NVLAG == 2) THEN
  CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
   & LLNOSLHD,LQMP,LQMHP,&
   & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
   & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
   & PB1(1,MSLB1C9),PCF)
ENDIF

! --- 3D part of the RHS requiring a trilinear interpolation:
IF(NVLAG == 3) THEN
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
   & PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
   & PB1(1,MSLB1C9),PCF)  
  IF (LSLINLC1.OR.(LSLINLC2.AND. NCURRENT_ITER == 0)) THEN
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
     & PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
     & PB1(1,MSLB1C9_SI),PCF_SI)  
  ENDIF
ENDIF

! --- 2D part of the RHS requiring a "high order" interpolation:
IF(.NOT.LQMP.AND..NOT.LQMHP) THEN
  CALL LAIDDI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,0, &
   & PCLA,PDLO,PCLO,KLH0(1,1,0),PB1(1,MSLB1SP9),PDP)
ELSE
  CALL LAIDDI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,1, &
   & PCLA,PDLO,PCLO,KLH0(1,1,0),PB1(1,MSLB1SP9),PDP)
ENDIF

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

!*       5.    ORIGIN POINT INTERPOLATIONS FOR SOME MISCELLANEOUS VARIABLES.
!              -------------------------------------------------------------

! * The interpolations are tri-dimensional ones (excepted for
!   the horizontal quantity "GWD" which requires a horizontal
!   interpolation).
!   Remark: the available 3D "high order" interpolators are
!   LAITRI, LAITQM and LAITQMH (called via LAITRE_GMV and LAITRE_GFL);
!   the 3D trilinear interpolator is LAITLI;
!   the available 2D "high order" interpolator is LAIDDI.
!   The SLHD interpolator is never applied on these variables.

! * 3D term "Y" used in the predictor of "LPC_OLD" PC-scheme (NH only):
!   It requires a trilinear interpolation.

IF( (NCURRENT_ITER == 0).AND.LPC_OLD.AND.LNHDYN )THEN
  CALL LAITLI(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,&
   & NFLEN,PDLAT,PDLO(1,1,1),KL0(1,1,1),PDVER,&
   & PB1(1,MSLB1Y9),PYF)  
ENDIF

! * Term "rs/a" used for the deep atmosphere formulation of equations:
!   It requires a "high order" interpolation.

IF ((LVERCOR.OR.(LRWSDLW.AND.LRWSDLR)).AND.LADVFW) THEN
  CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,NFLEVG,NFLSA,NFLEN,&
   & LLNOSLHD,LQMW,LQMHW,&
   & KL0(1,1,0),PDLO,PCLO,PCLOSLD, &
   & PDLAT,PCLA,PCLASLD,PVINTW,PVINTWSLD, &
   & PB1(1,MSLB1RSSA9),PRSAF)
ENDIF

! * Additional terms required for diagnostic BBC in NH model.
!   - Quantity "GWS" requires a 2D horizontal "high order" interpolation.
!   - If NSVDLAG=2, quantities "DBBC" and "DPHI" requires a "high order"
!     interpolation (SLHD interpolations, vertical Hermite cubic and
!     vertical spline cubic interpolations are not coded for these
!     quantities).
!   - If NSVDLAG=3, quantities "DBBC" and "DPHI" requires a trilinear
!     interpolation.
!   - Note that the calculation which is done for "DBBC" and "DPHI"
!     only provides the interpolated value for the bottom full layer.

IF (LNHDYN.AND.LRDBBC) THEN

  IF(.NOT.LQMHVD.AND..NOT.LQMVD) THEN
    CALL LAIDDI(NASLB1,NPROMA,KST,KPROF,1,NFLSA,NFLEN,0, &
     & PCLA(1:NPROMA,NFLEVG,1:3),PDLO(1:NPROMA,NFLEVG,0:3), &
     & PCLO(1:NPROMA,NFLEVG,1:3,1:2),KLH0(1:NPROMA,NFLEVG,0:3), &
     & PB1(1,MSLB1GWS9),PGWSF)
  ELSE
    CALL LAIDDI(NASLB1,NPROMA,KST,KPROF,1,NFLSA,NFLEN,1, &
     & PCLA(1:NPROMA,NFLEVG,1:3),PDLO(1:NPROMA,NFLEVG,0:3), &
     & PCLO(1:NPROMA,NFLEVG,1:3,1:2),KLH0(1:NPROMA,NFLEVG,0:3), &
     & PB1(1,MSLB1GWS9),PGWSF)
  ENDIF

  IF (NSVDLAG == 2) THEN

    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,1,NFLSA,NFLEN, &
     & LLNOSLHD,LQMVD,LQMHVD, &
     & KL0(1:NPROMA,NFLEVG,0:3),PDLO(1:NPROMA,NFLEVG,0:3), &
     & PCLO(1:NPROMA,NFLEVG,1:3,1:2),PCLOSLD(1:NPROMA,NFLEVG,1:3,1:2), &
     & PDLAT(1:NPROMA,NFLEVG), &
     & PCLA(1:NPROMA,NFLEVG,1:3),PCLASLD(1:NPROMA,NFLEVG,1:3), &
     & PVINTW(1:NPROMA,NFLEVG,1:3),PVINTWSLD(1:NPROMA,NFLEVG,1:3), &
     & PB1(1,MSLB1DBBC9),PDBBCF)
    CALL LAITRE_GMV(NASLB1,NPROMA,KST,KPROF,1,NFLSA,NFLEN, &
     & LLNOSLHD,LQMVD,LQMHVD, &
     & KL0(1:NPROMA,NFLEVG,0:3),PDLO(1:NPROMA,NFLEVG,0:3), &
     & PCLO(1:NPROMA,NFLEVG,1:3,1:2),PCLOSLD(1:NPROMA,NFLEVG,1:3,1:2), &
     & PDLAT(1:NPROMA,NFLEVG), &
     & PCLA(1:NPROMA,NFLEVG,1:3),PCLASLD(1:NPROMA,NFLEVG,1:3), &
     & PVINTW(1:NPROMA,NFLEVG,1:3),PVINTWSLD(1:NPROMA,NFLEVG,1:3), &
     & PB1(1,MSLB1DPHI9),PDPHIF)

  ELSEIF (NSVDLAG == 3) THEN

    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,1,NFLSA,&
     & NFLEN,PDLAT(1:NPROMA,NFLEVG),PDLO(1:NPROMA,NFLEVG,1:2),&
     & KL0(1:NPROMA,NFLEVG,1:2),PDVER(1:NPROMA,NFLEVG),&
     & PB1(1,MSLB1DBBC9),PDBBCF)  
    CALL LAITLI(NASLB1,NPROMA,KST,KPROF,1,NFLSA,&
     & NFLEN,PDLAT(1:NPROMA,NFLEVG),PDLO(1:NPROMA,NFLEVG,1:2),&
     & KL0(1:NPROMA,NFLEVG,1:2),PDVER(1:NPROMA,NFLEVG),&
     & PB1(1,MSLB1DPHI9),PDPHIF)  

  ENDIF

ENDIF

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

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