MODULE YOMSLREP

USE PARKIND1  ,ONLY : JPIM     ,JPRB

IMPLICIT NONE

SAVE

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

!     USED FOR BIT REPRODUCIBILITY OF SEMI-LAGRANGIAN ADJOINT (SLAD)

!     LSLADREP   : CONTROL BIT REPRODUCIBILITY
!                : T - SLAD IS BIT REPRODUCIBLE WHEN NUMBER OF PROCESSORS
!                :     OR PARTITITIONING IS CHANGED
!                : F - SLAD IS NOT BIT REPRODUCIBLE WHEN NUMBER OF PROCESSORS
!                :     OR PARTITITIONING IS CHANGED
!     LVECADIN   : CONTROL VECTOR/SCALAR FOR ADJOINT INTERPOLATION
!     NSLMAP     : USED FOR REMAPPING POINTS IN SL BUFFER SO THAT THEY
!                : ARE UNIQUE
!     NADCORE    : INNER HALO FOR ADJOINT INTERPOLATIONS
!                : ARE UNIQUE
!     LSLCORE    : T - IF NSLCORE POINT, F - IF NOT
!     NGPTOTAD   : NUMBER OF GRID POINTS IN INNER HALO
!     MASK_SLTOT : SUM OF SL BUFFER POINTS USED IN TRAJECTORY CALC.
!                : USED TO OPTIMISE NGPTOTAD AND THEREBY IMPROVE PERFORMANCE
!     RSASIGN    : USED FOR CORRECTING SYMMETRIC / ANTISYMMETRIC PROPERTIES
!                : (MIRRORED LATITUDES NEAR POLES)

!     GEMUAD     : SEMI-LAGRANGIAN ADJOINT VERSION OF GEMU
!     GESLOAD    : SEMI-LAGRANGIAN ADJOINT VERSION OF GESLO
!     GECLOAD    : SEMI-LAGRANGIAN ADJOINT VERSION OF GECLO
!     GMAD       : SEMI-LAGRANGIAN ADJOINT VERSION OF GM
!     GNORDLAD   : SEMI-LAGRANGIAN ADJOINT VERSION OF GNORDL
!     GNORDMAD   : SEMI-LAGRANGIAN ADJOINT VERSION OF GNORDM
!     GSQM2AD    : SEMI-LAGRANGIAN ADJOINT VERSION OF GSQM2
!     RCOLONAD   : SEMI-LAGRANGIAN ADJOINT VERSION OF RCOLON
!     RSILONAD   : SEMI-LAGRANGIAN ADJOINT VERSION OF RSILON
!     RINDXAD    : SEMI-LAGRANGIAN ADJOINT VERSION OF RINDX
!     RINDYAD    : SEMI-LAGRANGIAN ADJOINT VERSION OF RINDY

LOGICAL   :: LSLADREP
LOGICAL   :: LVECADIN
INTEGER(KIND=JPIM) :: NGPTOTAD

INTEGER(KIND=JPIM),ALLOCATABLE :: NSLMAP(:)
INTEGER(KIND=JPIM),ALLOCATABLE :: NADCORE(:)
INTEGER(KIND=JPIM),ALLOCATABLE :: MASK_SLTOT(:)
LOGICAL,ALLOCATABLE   :: LSLCORE (:)

REAL(KIND=JPRB),ALLOCATABLE :: RSASIGN(:,:)

REAL(KIND=JPRB),ALLOCATABLE :: GEMUAD  (:)
REAL(KIND=JPRB),ALLOCATABLE :: GESLOAD (:)
REAL(KIND=JPRB),ALLOCATABLE :: GECLOAD (:)
REAL(KIND=JPRB),ALLOCATABLE :: GMAD    (:)
REAL(KIND=JPRB),ALLOCATABLE :: GNORDLAD(:)
REAL(KIND=JPRB),ALLOCATABLE :: GNORDMAD(:)
REAL(KIND=JPRB),ALLOCATABLE :: GSQM2AD (:)
REAL(KIND=JPRB),ALLOCATABLE :: RCOLONAD(:)
REAL(KIND=JPRB),ALLOCATABLE :: RSILONAD(:)
REAL(KIND=JPRB),ALLOCATABLE :: RINDXAD (:)
REAL(KIND=JPRB),ALLOCATABLE :: RINDYAD (:)

!     ------------------------------------------------------------------
END MODULE YOMSLREP
