#ifdef RS6K
@PROCESS NOCHECK
#endif
SUBROUTINE CALL_SL( &
 ! --- INPUT ------------------------------------------------------------------
 & CDCONF,&
 ! --- INPUT/OUTPUT -----------------------------------------------------------
 & KVSEPC,KVSEPL,PB1,PB2,PGFLT1,&
 ! --- OUTPUT -----------------------------------------------------------------
 & PUP9,PVP9,PTP9,PGFLP9)

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

USE YOMCT0   , ONLY : LSLAG    ,LRPLANE  ,NPROC  ,LNHDYN   ,LPC_CHEAP
USE YOMCVER  , ONLY : LVERTFE  ,LVFE_GW
USE YOMGC    , ONLY : GEMU     ,GECLO    ,GESLO  ,GM       ,&
 & OROG     ,OROGL    ,OROGM    ,&
 & GNORDL   ,GNORDM   ,GSQM2    ,GOMVRL   ,GOMVRM  
USE YOMSC2   , ONLY : NSLWIDE   ,NFLDSLB1 ,NFLDSLB2
USE YOMGEM   , ONLY : RCOLON   ,RSILON   ,RINDX    ,RINDY    ,&
 & NGPTOT   ,NLOENG  
USE YOMDIM   , ONLY : NFLEVG   ,NPROMA   ,NGPBLKS  ,&
 & NDGLG    ,NDGSAG   ,NDGENG   ,NDGSAL   ,NDGENL   ,NFLSUL
USE YOMSLPHY , ONLY : LSLPHY
USE YOMDYNA  , ONLY : LGWADV
USE YOMDYN   , ONLY : NCURRENT_ITER 
USE YOM_YGFL , ONLY : YGFL     ,YQ
USE YOMGFL   , ONLY : GFL      ,GFLPC
USE PTRSLB1  , ONLY : MSLB1UR0 ,MSLB1WR0 ,RPARSL1
USE YOMMP    , ONLY : NASLB1   ,NSLPROCS ,&
 & NSLRPT    ,NSLSPT    ,NSLSENDPOS,&
 & NSLRECVPOS,NSENDPTR  ,NRECVPTR  ,NSLCOMM   ,&
 & NSLSTA    ,NSLONL    ,NSLOFF    ,NFRSTLOFF ,&
 & MYFRSTACTLAT         ,MYLSTACTLAT  
USE YOMMASK  , ONLY : LSLONDEM,  NFIXSFLD, LSLONDEM_ACTIVE,&
 & MASK_SL1,MASK_SL2,MASK_SL2A,MASK_SL3,MFIELD_TYPE1,LNEW_MASK_SL  
USE YOEPHY   , ONLY : LEPHYS   ,LAGPHY
USE YOMPHY   , ONLY : LMPHYS
USE YOMGMV   , ONLY : GMVT1,GMVT1S

USE YOE_CUCONVCA  , ONLY : LCUCONV_CA, LCA_ADVECT, RLATDEP, RLONDEP

!**** *CALL_SL* - Semi-Lagrangian Interpolation

!     Purpose.
!     --------
!           Semi-Lagrangian Interpolation

!**   Interface.
!     ----------
!        *CALL* *CALL_SL*

!        Explicit arguments :
!        --------------------
!        INPUT:
!          CDCONF      - conf. of work (will be needed for impl. physics)

!        INPUT/OUTPUT:
!          KVSEPC      - vertical separation (used in SL adjoint, cubic interp)
!          KVSEPL      - vertical separation (used in SL adjoint, linear intrp)
!          PB1         - SLBUF1-buffer for interpolations.
!          PB2         - SLBUF2-buf to communicate info from non lag to lag dyn.
!          PGFLT1      - SL-buf to communicate info on unified_treatment
!                        grid-point fields

!        OUTPUT:
!          PUP9        - Interpolated quantity at O in U-wind eqn
!                        for split physics (if LSLPHY=.T. only).
!          PVP9        - Interpolated quantity at O in V-wind eqn
!                        for split physics (if LSLPHY=.T. only).
!          PTP9        - Interpolated quantity at O in T eqn
!                        for split physics (if LSLPHY=.T. only).
!          PGFLP9      - Interpolated quantity at O in unified_treatment
!                        grid-point fields

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

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

!     Externals.
!     ----------
!        Called by GP_MODEL.

!     Author.
!     -------
!        Deborah Salmond 

! Modifications
! -------------
!   Modified 00-11-07 by C. Temperton: changed call to LAPINE_TRAJ
!   Modified 00-11-23 by C. Temperton: renamed _TRAJ and _INT routines.
!   Modified 01-03-16 by M. Janousek: add calls to LAM 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).
!    - Restore options using Hermite vertical interpolations.
!   Modified 01-08-30 by K. YESSAD: pruning and some other cleanings.
!   Modified at ECMWF (24 -> 24R1): some local arrays become allocatable.
!   Modified 01-10-15 D.Salmond: FULLIMP mods.
!   Modified 02-10-01 G.Mozdzynski: support for radiation on-demand comms
!   Modified 03-2002  J.Vivoda : PC schemes for NH dynamics (LPC_XXXX keys)
!   Modified 09-2002  P.Smolikova: variable d4 in NH
!   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 04-2003  K. YESSAD: bug correction.
!   Modified 03-10-01 G. Radnoti: update calls to eslextpol*
!   Modified 08-2003  F. Vana: option LSLHD.
!   Modified 08-2003  P.Smolikova: option LRDBBC.
!   01-Oct-2003 M. Hamrud  CY28 Cleaning
!   M.Hortal  01-Dec-2003 Extra-fields produced in the dynamics
!   D.Salmond 22-Dec-2003 Karim's Larcin cleaning
!   10-Jun-2004 J. Masek   NH cleaning (LPC_NOTR)
!   Modified 04-11-04 F. Vana: regularization of SLHD
!   20-Feb-2005 J. Vivoda GWADV scheme for PC_FULL 
!   14-Oct-2005 Y. Bouteloup SL computation of CVGQ for French physics
!   22-02-2006 O. Spaniel: Phasing CY31
!   K. Yessad 07-02-2007: Splitting alti/surf for (gw) in NH+LGWADV.
!   K. Yessad 07-03-2007: Remove useless (gw)_surf interpolations in NH+LGWADV.
!   Modified 28-Aug-2007 F. Vana: removing 4 points splines arrays
!   N. Wedi and K. Yessad (Jan 2008): different dev for NH model and PC scheme
!   26-Aug-2008 J. Masek and F. Vana   New dataflow for SLHD interpolators.
!   K. Yessad Nov 2008: rationalisation of dummy argument interfaces
!   K. Yessad Dec 2008: merge SLCOMM+SLCOMM1 -> SLCOMM.
!   K. Yessad Dec 2008: merge the different (E)SLEXTPOL.. -> (E)SLEXTPOL.
! End Modifications
!------------------------------------------------------------------------------

IMPLICIT NONE

CHARACTER(LEN=1)  ,INTENT(IN)    :: CDCONF 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KVSEPC(NGPBLKS) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KVSEPL(NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PB1(NASLB1,NFLDSLB1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PB2(NPROMA,NFLDSLB2,NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PGFLT1(NPROMA,NFLEVG,YGFL%NDIM1,NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PUP9(NPROMA,NFLEVG,NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PVP9(NPROMA,NFLEVG,NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTP9(NPROMA,NFLEVG,NGPBLKS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PGFLP9(NPROMA,NFLEVG,YGFL%NUMFLDS,NGPBLKS) 

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

INTEGER(KIND=JPIM) :: JSTGLO, IST, IEND, IBL, IOFF

LOGICAL :: LLINC, LLSLPHY, LLDIAB, LLADNMI, LLVFE_EQNGW, LLEXCLUDE
INTEGER(KIND=JPIM) :: IDUMARR(2)

! * Indices for interpolation of full-level data.
INTEGER(KIND=JPIM), ALLOCATABLE :: IL0 (:,:,:,:)      ! index for interp. grid.
INTEGER(KIND=JPIM), ALLOCATABLE :: ILH0 (:,:,:,:)     ! 2nd index
!                                                       for interp. grid.
INTEGER(KIND=JPIM), ALLOCATABLE :: ILEV(:,:,:)        ! vertical index for
!                                                       interp. grid.
! * Indices for interpolation of half-level (interface) data.
INTEGER(KIND=JPIM), ALLOCATABLE :: IL0H (:,:,:,:)     ! index for interp. grid.

! * interpolated quantities arrays.
REAL(KIND=JPRB) :: ZUF (NPROMA,NFLEVG,NGPBLKS)       ! cf. PUF in LAPINEA.
REAL(KIND=JPRB) :: ZVF (NPROMA,NFLEVG,NGPBLKS)       ! cf. PVF in LAPINEA.
! * weights, interpolation grid, geometry.
REAL(KIND=JPRB) :: ZLON(NPROMA,NFLEVG,NGPBLKS)        ! cf. PLON in LAPINEB.
REAL(KIND=JPRB) :: ZLAT(NPROMA,NFLEVG,NGPBLKS)        ! cf. PLAT in LAPINEB.
REAL(KIND=JPRB) :: ZQX(NPROMA,NFLEVG,NGPBLKS)        ! cf. PQX in LAPINEB.
REAL(KIND=JPRB) :: ZQY(NPROMA,NFLEVG,NGPBLKS)        ! cf. PQY in LAPINEB.
REAL(KIND=JPRB) :: ZR(NPROMA,NFLEVG)                 ! cf. PR in LAPINEB.
REAL(KIND=JPRB) :: ZS(NPROMA,NFLEVG)                 ! cf. PS in LAPINEB.
REAL(KIND=JPRB) :: ZVDERW(NPROMA,NFLEVG,2,2,NGPBLKS) ! cf. PVDERW in LAPINEB.
REAL(KIND=JPRB) :: ZHVW(NPROMA,NFLEVG,4,NGPBLKS)     ! cf. PHVW in LAPINEB.

! * Interpolation weights and indices for interpolation of layer quantities
REAL(KIND=JPRB), ALLOCATABLE :: ZDLO(:,:,:,:)       ! cf. PDLO in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLO(:,:,:,:,:)     ! cf. PCLO in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLOSLD(:,:,:,:,:)  ! cf. PCLOSLD in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZDLAT(:,:,:)        ! cf. PDLAT in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLA(:,:,:,:)       ! cf. PCLA in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLASLD(:,:,:,:)    ! cf. PCLASLD in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZDVER(:,:,:)        ! cf. PDVER in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZVINTW(:,:,:,:)     ! cf. PVINTW in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZVINTWSLD(:,:,:,:)  ! cf. PVINTWSLD in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZVINTWS(:,:,:,:)    ! cf. PVINTWS in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCOSCO(:,:,:)       ! cf. PCOSCO in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZSINLA(:,:,:)       ! cf. PSINLA in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZSINCO(:,:,:)       ! cf. PSINCO in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCOPHI(:,:,:)       ! cf. PCOPHI in LAPINEB

! * Interpolation weights and indices for interp. of interlayer quantities
REAL(KIND=JPRB), ALLOCATABLE :: ZDLOH(:,:,:,:)      ! cf. PDLOH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLOH(:,:,:,:,:)    ! cf. PCLOH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLOHSLD(:,:,:,:,:) ! cf. PCLOHSLD in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZDLATH(:,:,:)       ! cf. PDLATH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLAH(:,:,:,:)      ! cf. PCLAH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZCLAHSLD(:,:,:,:)   ! cf. PCLAHSLD in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZDVERH(:,:,:)       ! cf. PDVERH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZVINTWH(:,:,:,:)    ! cf. PVINTWH in LAPINEB
REAL(KIND=JPRB), ALLOCATABLE :: ZVINTWHSLD(:,:,:,:) ! cf. PVINTWHSLD in LAPINEB

REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "eslextpol.intfb.h"
#include "lapinea.intfb.h"
#include "lapineb.intfb.h"
#include "slcomm.intfb.h"
#include "slcomm2a.intfb.h"
#include "slextpol.intfb.h"

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

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

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

!*       0.    PRELIMINAR ALLOCATIONS.
!              -----------------------

ALLOCATE(ZDLO(NPROMA,NFLEVG,0:3,NGPBLKS))
ALLOCATE(ZCLO(NPROMA,NFLEVG,3,2,NGPBLKS))
ALLOCATE(ZCLOSLD(NPROMA,NFLEVG,3,2,NGPBLKS))
ALLOCATE(IL0(NPROMA,NFLEVG,0:3,NGPBLKS))
ALLOCATE(ILH0(NPROMA,NFLEVG,0:3,NGPBLKS))
ALLOCATE(ZDLAT(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZCLA(NPROMA,NFLEVG,3,NGPBLKS))
ALLOCATE(ZCLASLD(NPROMA,NFLEVG,3,NGPBLKS))
ALLOCATE(ILEV(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZDVER(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZVINTW(NPROMA,NFLEVG,3,NGPBLKS))
ALLOCATE(ZVINTWSLD(NPROMA,NFLEVG,3,NGPBLKS))
ALLOCATE(ZVINTWS(NPROMA,NFLEVG,1:4,NGPBLKS))
ALLOCATE(ZCOSCO(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZSINLA(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZSINCO(NPROMA,NFLEVG,NGPBLKS))
ALLOCATE(ZCOPHI(NPROMA,NFLEVG,NGPBLKS))

! * Allocate weights and indices arrays for half-level interp.
LLVFE_EQNGW=LVERTFE.AND.LVFE_GW
IF ( LNHDYN.AND.LGWADV.AND.(.NOT.LLVFE_EQNGW) ) THEN
  ALLOCATE(ZDLOH(NPROMA,0:NFLEVG-1,0:3,NGPBLKS))
  ALLOCATE(ZCLOH(NPROMA,0:NFLEVG-1,3,2,NGPBLKS))
  ALLOCATE(ZCLOHSLD(NPROMA,0:NFLEVG-1,3,2,NGPBLKS))
  ALLOCATE(IL0H(NPROMA,0:NFLEVG-1,0:3,NGPBLKS))
  ALLOCATE(ZDLATH(NPROMA,0:NFLEVG-1,NGPBLKS))
  ALLOCATE(ZCLAH(NPROMA,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZCLAHSLD(NPROMA,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZDVERH(NPROMA,0:NFLEVG-1,NGPBLKS))
  ALLOCATE(ZVINTWH(NPROMA,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZVINTWHSLD(NPROMA,0:NFLEVG-1,3,NGPBLKS))
ELSE
  ALLOCATE(ZDLOH(1,0:NFLEVG-1,0:3,NGPBLKS))
  ALLOCATE(ZCLOH(1,0:NFLEVG-1,3,2,NGPBLKS))
  ALLOCATE(ZCLOHSLD(1,0:NFLEVG-1,3,2,NGPBLKS))
  ALLOCATE(IL0H(1,0:NFLEVG-1,0:3,NGPBLKS))
  ALLOCATE(ZDLATH(1,0:NFLEVG-1,NGPBLKS))
  ALLOCATE(ZCLAH(1,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZCLAHSLD(1,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZDVERH(1,0:NFLEVG-1,NGPBLKS))
  ALLOCATE(ZVINTWH(1,0:NFLEVG-1,3,NGPBLKS))
  ALLOCATE(ZVINTWHSLD(1,0:NFLEVG-1,3,NGPBLKS))
ENDIF

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

!*       1.    PRELIMINAR INITIALISATIONS.
!              ---------------------------

! * Adiabatic NNMI iteration
LLADNMI = CDCONF == 'E' .OR. CDCONF == 'F'

! * Lagged physics is called.
LLDIAB = (LMPHYS.OR.LEPHYS) .AND. LAGPHY
LLSLPHY = LSLPHY.AND.LLDIAB.AND.LSLAG.AND..NOT.LLADNMI
LLINC=.FALSE.
LLEXCLUDE=.TRUE.

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

!*       2.    FIRST PART OF PROCESSOR COMMUNICATIONS WHEN NEEDED.
!              ---------------------------------------------------

IF( .NOT.(LPC_CHEAP.AND.(NCURRENT_ITER > 0)) ) THEN

  CALL GSTATS(8,2)
  CALL GSTATS(51,0)

  IF (NPROC > 1) THEN

    IF(LSLONDEM)THEN
      LNEW_MASK_SL=.TRUE.
      LSLONDEM_ACTIVE=.TRUE.
      NFIXSFLD(1)=MSLB1UR0
      NFIXSFLD(2)=MSLB1WR0+NFLEVG+NFLSUL
    ENDIF

    IF (LSLONDEM_ACTIVE) THEN
      CALL SLCOMM(NASLB1,NSLPROCS,NSLRPT,&
       & NSLSPT,NSLSENDPOS,NSLRECVPOS,NSENDPTR,NRECVPTR,NSLCOMM,&
       & NFIXSFLD,NFLDSLB1,LLINC,1,PB1)  
    ELSE
      CALL SLCOMM(NASLB1,NSLPROCS,NSLRPT,&
       & NSLSPT,NSLSENDPOS,NSLRECVPOS,NSENDPTR,NRECVPTR,NSLCOMM,&
       & IDUMARR,NFLDSLB1,LLINC,0,PB1)  
    ENDIF

  ENDIF

  IF (LSLONDEM_ACTIVE) THEN
    IF(ALLOCATED(MASK_SL2))DEALLOCATE(MASK_SL2)
    ALLOCATE(MASK_SL2(NASLB1+4))
    IF(ALLOCATED(MASK_SL2A))DEALLOCATE(MASK_SL2A)
    ALLOCATE(MASK_SL2A(NASLB1+4))
    IF(ALLOCATED(MASK_SL3))DEALLOCATE(MASK_SL3)
    ALLOCATE(MASK_SL3(NASLB1+4))
    MASK_SL2=0
    MASK_SL2A=0 
    MASK_SL3=0
    IF (.NOT.LRPLANE) THEN
      CALL SLEXTPOL(NSLWIDE,NSLWIDE,&
       & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
       & NDGLG,NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,NFIXSFLD,3,&
       & RPARSL1,PB1,KMASK3=MASK_SL3)  
    ELSE
      CALL ESLEXTPOL(NSLWIDE,NSLWIDE,&
       & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
       & NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,NFIXSFLD,3,&
       & PB1,KMASK3=MASK_SL3)  
    ENDIF
  ELSE
    IF (.NOT.LRPLANE) THEN
      CALL SLEXTPOL(NSLWIDE,NSLWIDE,&
       & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
       & NDGLG,NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,IDUMARR,1,&
       & RPARSL1,PB1)  
    ELSE
      CALL ESLEXTPOL(NSLWIDE,NSLWIDE,&
       & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
       & NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,IDUMARR,1,&
       & PB1)  
    ENDIF
  ENDIF

  CALL GSTATS(51,1)
  CALL GSTATS(37,0)

ENDIF

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

!*       3.    SL-TRAJECTORY RESEARCH, WEIGHTS AND INTERP. GRID CALCULATION.
!              -------------------------------------------------------------

IF( .NOT.(LPC_CHEAP.AND.(NCURRENT_ITER > 0)) ) THEN

  CALL GSTATS(1004,0)

!$OMP PARALLEL DO SCHEDULE(DYNAMIC,1)&
!$OMP&PRIVATE(JSTGLO,IST,IEND,IBL,IOFF,ZR,ZS)
  DO JSTGLO=1,NGPTOT,NPROMA
    IST=1
    IEND=MIN(NPROMA,NGPTOT-JSTGLO+1)
    IBL=(JSTGLO-1)/NPROMA+1
    IOFF=JSTGLO

    CALL LAPINEA( &
     ! --- INPUT --------------------------------------------------------------
     & IST,IEND,&
     & RCOLON(IOFF),RSILON(IOFF),GM(IOFF),GEMU(IOFF),GSQM2(IOFF),&
     & GECLO(IOFF),GESLO(IOFF),GNORDL(IOFF),GNORDM(IOFF),&
     & RINDX(IOFF),RINDY(IOFF),&
     & PB1(1,1),PB2(1,1,IBL),&
     ! --- INPUT/OUTPUT -------------------------------------------------------
     & KVSEPC(IBL),KVSEPL(IBL),&
     ! --- OUTPUT -------------------------------------------------------------
     & ZLON(1,1,IBL),ZLAT(1,1,IBL),&
     & ZQX(1,1,IBL),ZQY(1,1,IBL),ZR,ZS,&
     & ZUF(1,1,IBL),ZVF(1,1,IBL),&
     & IL0(1,1,0,IBL),ILH0(1,1,0,IBL),&
     & ZDLO(1,1,0,IBL),ZCLO(1,1,1,1,IBL),ZCLOSLD(1,1,1,1,IBL),&
     & ZDLAT(1,1,IBL),ZCLA(1,1,1,IBL),ZCLASLD(1,1,1,IBL),&
     & ILEV(1,1,IBL),ZDVER(1,1,IBL),&
     & ZVINTW(1,1,1,IBL),ZVINTWSLD(1,1,1,IBL),ZVINTWS(1,1,1,IBL),&
     & IL0H(1,0,0,IBL),&
     & ZDLOH(1,0,0,IBL),ZCLOH(1,0,1,1,IBL),ZCLOHSLD(1,0,1,1,IBL),&
     & ZDLATH(1,0,IBL),ZCLAH(1,0,1,IBL),ZCLAHSLD(1,0,1,IBL),&
     & ZDVERH(1,0,IBL),ZVINTWH(1,0,1,IBL),ZVINTWHSLD(1,0,1,IBL),&
     & ZCOSCO(1,1,IBL),ZSINCO(1,1,IBL),ZCOPHI(1,1,IBL),ZSINLA(1,1,IBL),&
     & ZVDERW(1,1,1,1,IBL),ZHVW(1,1,1,IBL),PGFLT1(1,1,1,IBL))

  ENDDO

!$OMP END PARALLEL DO
  CALL GSTATS(1004,1)

  IF (LCUCONV_CA .AND. LCA_ADVECT) THEN
    RLONDEP(:,:,:)=ZLON(:,:,:)
    RLATDEP(:,:,:)=ZLAT(:,:,:)
  ENDIF

ENDIF

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

!*       4.    SECOND PART OF PROCESSOR COMMUNICATIONS WHEN NEEDED.
!              ----------------------------------------------------

IF( .NOT.(LPC_CHEAP.AND.(NCURRENT_ITER > 0)) .AND. &
 & (NPROC > 1 .AND. LSLONDEM_ACTIVE)) THEN

  LLINC=.FALSE.
  CALL GSTATS(37,2)
  CALL GSTATS(89,0)

  CALL SLCOMM2A(NASLB1,NSLPROCS,NSLRPT,&
   & NSLSPT,NSLSENDPOS,NSLRECVPOS,NSENDPTR,NRECVPTR,NSLCOMM,&
   & NFIXSFLD,LLEXCLUDE,MASK_SL1,MASK_SL2,MASK_SL2A,MASK_SL3,&
   & NFLDSLB1,LLINC,PB1,MFIELD_TYPE1)  

  CALL GSTATS(89,1)
  CALL GSTATS(37,3)

  IF (.NOT.LRPLANE) THEN
    CALL SLEXTPOL(NSLWIDE,NSLWIDE,&
     & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
     & NDGLG,NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,NFIXSFLD,2,&
     & RPARSL1,PB1)  
  ELSE
    CALL ESLEXTPOL(NSLWIDE,NSLWIDE,&
     & NASLB1,NDGSAG,NDGENG,NDGSAL,NDGENL,NFLDSLB1,NSLSTA,NSLONL,NSLOFF,&
     & NLOENG,NFRSTLOFF,MYFRSTACTLAT,MYLSTACTLAT,NFIXSFLD,2,&
     & PB1)  
  ENDIF

ENDIF

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

!*       5.    INTERPOLATIONS.
!              ---------------

CALL GSTATS(1005,0)

!$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) PRIVATE(JSTGLO,IST,IEND,IBL,IOFF )
DO JSTGLO=1,NGPTOT,NPROMA
  IST=1
  IEND=MIN(NPROMA,NGPTOT-JSTGLO+1)
  IBL=(JSTGLO-1)/NPROMA+1
  IOFF=JSTGLO

  CALL LAPINEB( &
   ! --- INPUT -------------------------------------------------------------
   & NFLDSLB2,IST,IEND,IOFF,LLSLPHY,&
   & RCOLON(IOFF),RSILON(IOFF),GM(IOFF),GEMU(IOFF),&
   & GSQM2(IOFF),GECLO(IOFF),GESLO(IOFF),&
   & GNORDL(IOFF),GNORDM(IOFF),GOMVRL(IOFF),GOMVRM(IOFF),&
   & RINDX(IOFF),RINDY(IOFF),&
   & OROG(IOFF),OROGL(IOFF),OROGM(IOFF),&
   & IL0(1,1,0,IBL),ILH0(1,1,0,IBL),ZDLO(1,1,0,IBL),&
   & ZCLO(1,1,1,1,IBL),ZCLOSLD(1,1,1,1,IBL),&
   & ZDLAT(1,1,IBL),ZCLA(1,1,1,IBL),ZCLASLD(1,1,1,IBL),&
   & ILEV(1,1,IBL),&
   & ZDVER(1,1,IBL),ZVINTW(1,1,1,IBL),ZVINTWSLD(1,1,1,IBL),&
   & ZVINTWS(1,1,1,IBL),ZVDERW(1,1,1,1,IBL),ZHVW(1,1,1,IBL),&
   & IL0H(1,0,0,IBL),&
   & ZDLOH(1,0,0,IBL),ZCLOH(1,0,1,1,IBL),ZCLOHSLD(1,0,1,1,IBL),&
   & ZDLATH(1,0,IBL),ZCLAH(1,0,1,IBL),ZCLAHSLD(1,0,1,IBL),&
   & ZDVERH(1,0,IBL),ZVINTWH(1,0,1,IBL),ZVINTWHSLD(1,0,1,IBL),&
   & ZUF(1,1,IBL),ZVF(1,1,IBL),&
   & PB1(1,1),GFL(1,1,YQ%MP,IBL),&
   ! --- INPUT/OUTPUT ------------------------------------------------------
   & KVSEPC(IBL),KVSEPL(IBL),&
   & ZCOSCO(1,1,IBL),ZSINCO(1,1,IBL),ZSINLA(1,1,IBL),ZCOPHI(1,1,IBL),&
   & ZLON(1,1,IBL),ZLAT(1,1,IBL),ZQX(1,1,IBL),ZQY(1,1,IBL),&
   & PB2(1,1,IBL),GMVT1(1,1,1,IBL),GMVT1S(1,1,IBL),PGFLT1(1,1,1,IBL),&
   & GFLPC(1,1,1,IBL), &
   ! --- OUTPUT ------------------------------------------------------------
   & PUP9(1,1,IBL),PVP9(1,1,IBL),PTP9(1,1,IBL),PGFLP9(1,1,1,IBL))

ENDDO

!$OMP END PARALLEL DO
CALL GSTATS(1005,1)

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

!*       6.    FINAL ACTIONS AND DESALLOCATIONS.
!              ---------------------------------

LSLONDEM_ACTIVE=.FALSE.
LNEW_MASK_SL=.FALSE.

DEALLOCATE(ZDLO)
DEALLOCATE(ZCLO)
DEALLOCATE(ZCLOSLD)
DEALLOCATE(IL0)
DEALLOCATE(ILH0)
DEALLOCATE(ZDLAT)
DEALLOCATE(ZCLA)
DEALLOCATE(ZCLASLD)
DEALLOCATE(ILEV)
DEALLOCATE(ZDVER)
DEALLOCATE(ZVINTW)
DEALLOCATE(ZVINTWSLD)
DEALLOCATE(ZVINTWS)
DEALLOCATE(ZCOSCO)
DEALLOCATE(ZSINLA)
DEALLOCATE(ZSINCO)
DEALLOCATE(ZCOPHI)

IF ( ALLOCATED(ZDLOH)      )  DEALLOCATE(ZDLOH)
IF ( ALLOCATED(ZCLOH)      )  DEALLOCATE(ZCLOH)
IF ( ALLOCATED(ZCLOHSLD)   )  DEALLOCATE(ZCLOHSLD)
IF ( ALLOCATED(IL0H)       )  DEALLOCATE(IL0H)
IF ( ALLOCATED(ZDLATH)     )  DEALLOCATE(ZDLATH)
IF ( ALLOCATED(ZCLAH)      )  DEALLOCATE(ZCLAH)
IF ( ALLOCATED(ZCLAHSLD)   )  DEALLOCATE(ZCLAHSLD)
IF ( ALLOCATED(ZDVERH)     )  DEALLOCATE(ZDVERH)
IF ( ALLOCATED(ZVINTWH)    )  DEALLOCATE(ZVINTWH)
IF ( ALLOCATED(ZVINTWHSLD) )  DEALLOCATE(ZVINTWHSLD)

IF( .NOT.(LPC_CHEAP.AND.(NCURRENT_ITER > 0)) ) THEN
  CALL GSTATS(37,1)
  CALL GSTATS(8,3)
ENDIF

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

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