MODULE YOMLAP

USE PARKIND1  ,ONLY : JPIM     ,JPRB

IMPLICIT NONE

SAVE

!     ------------------------------------------------------------------
!*    Constants related to the Laplace space

!  NLSCM(0:NSMAX)  : number of complex symmetric Laplace coefficient for m given
!  NLACM(0:NSMAX)  :    "   "  complex anti------    "        "        "     "
!  NLCM(0:NSMAX)   : number of complex Laplace coefficient for m given
!  NLSCN(0:NSMAX)  : number of complex symmetric Laplace coefficient for n given
!  NLACN(0:NSMAX)  :    "   "  complex anti------    "        "        "     "
!  NLCN(0:NSMAX)   : number of complex Laplace coefficient for n given
!  NASN0(0:NSMAX)  : address in a spectral array of (n, m=0)
!  NASM0(0:NSMAX)  : address in a spectral array of (m, n=m)
!  NASM0G(0:NSMAX) : address in a global version of spectral array of (m, n=m)
!  NASRN(0:NSMAX)  : number of real (and imaginary) Laplace coefficients
!                    for n given and m different from 0
!  NACM0(0:NCMAX)  : same as  NASM0 but for the geographic sphere (NCMAX)
!  NATM0(0:NTMAX)  : same as NASM0 but for NTMAX
!  NVALUE(NTPEC2)  : n value for each NSPEC2 spectral coeffient
!  NCVALUE(NTPEC2) : n value for each NCPEC2 spectral coeffient
!  NTVALUE(NTPEC2) : n value for each NTPEC2 spectral coeffient
!  NSTREL(NSPEC2)  : position of spectral coeffient in T-arrays
!  MYMS(0:NUMP)    : actual wave numbers handled by this processor
!  NSPINDX(NSEFRE) : Index relationship between spectral control
!                    variables and spectral state variables
!  NSPINDXG        : Global version of NSPINDX
!  NSPZERO(0:NSMAX): Index for the imaginary m=0 values
!  NSE0L(NUMP)     : Index array, used for example in Helmholtz operator and
!                    horizontal diffusion operator, to find the first element
!                    of the non-zero diagonals of these operators for each
!                    zonal wave number m. DM-local
!  NSPNSUM(0:NSMAX): Spectral coeffients up to and incl. a total wavenumber
!  NATCM0(0:NTCMAX): address in a spectral array of (m, n=m) corresponding
!                    to truncation NTCMAX (transmission coefficients).
!  NTCINDX         : index relationship between spectral control variables
!                    and spectral state variables for transmission
!                    coefficients.

INTEGER(KIND=JPIM),ALLOCATABLE:: NLSCM(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NLACM(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NLCM(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NLSCN(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NLACN(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NLCN(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NASN0(:)
INTEGER(KIND=JPIM),ALLOCATABLE,TARGET:: NASM0(:)
INTEGER(KIND=JPIM),ALLOCATABLE,TARGET:: NASM0G(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NASRN(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NACM0(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NATM0(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NVALUE(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NCVALUE(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NTVALUE(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NSTREL(:)
INTEGER(KIND=JPIM),ALLOCATABLE,TARGET:: MYMS(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NSPINDX(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NSPINDXG(:)
INTEGER(KIND=JPIM),ALLOCATABLE,TARGET:: NSPZERO(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NSE0L(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NSPNSUM(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NATCM0(:)
INTEGER(KIND=JPIM),ALLOCATABLE:: NTCINDX(:)

!  RLAPDI(-1:NSMAX+2) :  eigen-values of the Laplace operator
!  RLAPIN(-1:NSMAX+2) :  eigen-values of its inverse
!  RCAPDI(0:NCMAX)    :  same as RLAPDI but for NCMAX
!  RCAPIN(0:NCMAX)    :  same as RLAPIN but for NCMAX
!  RTAPDI(0:NTMAX)    :  same as RLAPDI but for NTMAX
!  RTAPIN(0:NTMAX)    :  same as RLAPIN but for NTMAX

REAL(KIND=JPRB),ALLOCATABLE,TARGET:: RLAPDI(:)
REAL(KIND=JPRB),ALLOCATABLE:: RLAPIN(:)
REAL(KIND=JPRB),ALLOCATABLE:: RCAPDI(:)
REAL(KIND=JPRB),ALLOCATABLE:: RCAPIN(:)
REAL(KIND=JPRB),ALLOCATABLE:: RTAPDI(:)
REAL(KIND=JPRB),ALLOCATABLE:: RTAPIN(:)

!     ------------------------------------------------------------------
END MODULE YOMLAP
