SUBROUTINE LAIDLI_INIT(KPROMA,KPROMB,KSTART,KPROF,KFLEV,KL0,&
 & KMAP,PSIGN )  

!**** *LAIDLI_INIT - semi-LAgrangian scheme:   (adjoint version)
!                 Initialise for Bilinear horizontal 4 point interpolations

!     Purpose.
!     --------
!       Performs initialisations for Bilinear horizontal 4 point interpolations

!**   Interface.
!     ----------
!        *CALL* *LAIDLI_INIT(KPROMA,KPROMB,KSTART,KPROF,KFLEV,KL0
!                      ,KMAP,PSIGN)

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

!        INPUT:
!          KPROMA  - horizontal dimension for grid-point quantities.
!          KPROMB  - horizontal dimension for interpolation point
!                    quantities.
!          KSTART  - first element of arrays where
!                    computations are performed.
!          KPROF   - depth of work.
!          KFLEV   - vertical dimension.
!          KL0     - indices of the four western points
!                    of the 16 points interpolation grid.
!        OUTPUT:
!          KMAP    - mapping array for bit reproducibility
!          PSIGN   - sign (+ or -) to be applied to point (symmetric/
!                    antisymmetric properties at polar latitudes)

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

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

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

!        No external.
!        Called by LARCINAD.

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

!     Author.
!     -------
!        G. Mozdzynski (ECMWF)

!     Modifications.
!     --------------
!      Original : 00/08/16
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

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

USE YOMSLREP , ONLY : NSLMAP, RSASIGN

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMB 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFLEV 
INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSTART 
INTEGER(KIND=JPIM),INTENT(IN)    :: KPROF 
INTEGER(KIND=JPIM),INTENT(IN)    :: KL0(KPROMB,KFLEV,1:2) 
INTEGER(KIND=JPIM),INTENT(OUT)   :: KMAP(KPROMB,4,KFLEV) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSIGN(KPROMB,4,KFLEV,2) 

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

INTEGER(KIND=JPIM) :: JLEV, JROF
INTEGER(KIND=JPIM) :: I1,I2,I3,I4
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

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

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

!*       1.    INTERPOLATIONS.
!              ---------------

DO JLEV=1,KFLEV

!OCL NOVREC
  DO JROF=KSTART,KPROF

    I1=KL0(JROF,JLEV,1)+1
    I2=KL0(JROF,JLEV,1)+2
    I3=KL0(JROF,JLEV,2)+1
    I4=KL0(JROF,JLEV,2)+2

    KMAP(JROF,1,JLEV)=NSLMAP(I1)
    KMAP(JROF,2,JLEV)=NSLMAP(I2)
    KMAP(JROF,3,JLEV)=NSLMAP(I3)
    KMAP(JROF,4,JLEV)=NSLMAP(I4)

    PSIGN(JROF,1,JLEV,1)=RSASIGN(MOD(I1-1,KPROMA)+1,1)
    PSIGN(JROF,1,JLEV,2)=RSASIGN(MOD(I1-1,KPROMA)+1,2)
    PSIGN(JROF,2,JLEV,1)=RSASIGN(MOD(I2-1,KPROMA)+1,1)
    PSIGN(JROF,2,JLEV,2)=RSASIGN(MOD(I2-1,KPROMA)+1,2)
    PSIGN(JROF,3,JLEV,1)=RSASIGN(MOD(I3-1,KPROMA)+1,1)
    PSIGN(JROF,3,JLEV,2)=RSASIGN(MOD(I3-1,KPROMA)+1,2)
    PSIGN(JROF,4,JLEV,1)=RSASIGN(MOD(I4-1,KPROMA)+1,1)
    PSIGN(JROF,4,JLEV,2)=RSASIGN(MOD(I4-1,KPROMA)+1,2)

  ENDDO

ENDDO

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