MODULE YOMSP

USE PARKIND1  ,ONLY : JPRB

IMPLICIT NONE

SAVE

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

!*    Spectral arrays
!     SP(X) for (X), SP5(X) for trajectory of (X),

! -   STATE VARIABLES OF THE MODEL

REAL(KIND=JPRB),ALLOCATABLE,TARGET :: SPA3(:,:,:)  ! 3D variables.
REAL(KIND=JPRB),ALLOCATABLE,TARGET :: SPA2(:,:)    ! 2D variables.
REAL(KIND=JPRB),ALLOCATABLE,TARGET :: SPAUX(:,:,:) ! auxiliary variables.
! -   MEAN VALUES OF THE WIND COMPONENTS (LAM)
REAL(KIND=JPRB),ALLOCATABLE,TARGET :: SPA1(:,:)    ! mean values of (U,V).

! -   TRAJECTORY

REAL(KIND=JPRB),ALLOCATABLE,TARGET:: SP5A3(:,:,:)  ! 3D variables.
REAL(KIND=JPRB),ALLOCATABLE,TARGET:: SP5A2(:,:)    ! 2D variables.
REAL(KIND=JPRB),ALLOCATABLE,TARGET:: SP5A1(:,:)    ! mean values of (U,V).

! -   "EXTRA SPECTRAL ARRAYS FOR SAVING PURPOSES"

REAL(KIND=JPRB),ALLOCATABLE:: SPA3SAVE(:,:,:)      ! 3D variables.
REAL(KIND=JPRB),ALLOCATABLE:: SPA2SAVE(:,:)        ! 2D variables.

REAL(KIND=JPRB),ALLOCATABLE:: SPSPSAVE(:)          ! SPSP variable.
REAL(KIND=JPRB),ALLOCATABLE:: SPA3INI(:,:,:)       ! 3D variables.
REAL(KIND=JPRB),ALLOCATABLE:: SPA2INI(:,:)         ! 2D variables.
REAL(KIND=JPRB),ALLOCATABLE:: SPA1INI(:,:)         ! mean values of (U,V).
!     ------------------------------------------------------------------

! -   Splitting of the array SPA3,SP5A3

!  === Momentum variables ===
REAL(KIND=JPRB),POINTER:: SPVOR(:,:)               ! Vorticity.
REAL(KIND=JPRB),POINTER:: SPDIV(:,:)               ! Divergence.

REAL(KIND=JPRB),POINTER:: SP5VOR(:,:)              ! Vorticity.
REAL(KIND=JPRB),POINTER:: SP5DIV(:,:)              ! Divergence.

!  === GMV Thermodynamical variables ===
REAL(KIND=JPRB),POINTER:: SPHV(:,:,:)              ! GMV thermodynamic var.
REAL(KIND=JPRB),POINTER:: SPT(:,:)                 ! Temperature.
REAL(KIND=JPRB),POINTER:: SPSPD(:,:)               ! Pressure departure var.
REAL(KIND=JPRB),POINTER:: SPSVD(:,:)               ! Vertical divergence var.
REAL(KIND=JPRB),POINTER:: SPNHX(:,:)               ! "X" part of total div.

REAL(KIND=JPRB),POINTER:: SP5HV(:,:,:)             ! GMV thermodynamic var.
REAL(KIND=JPRB),POINTER:: SP5T(:,:)                ! Temperature.
REAL(KIND=JPRB),POINTER:: SP5SPD(:,:)              ! Pressure departure var.
REAL(KIND=JPRB),POINTER:: SP5SVD(:,:)              ! Vertical divergence var.

!  === GFL variables ===
REAL(KIND=JPRB),POINTER:: SPGFL(:,:,:)             ! GFL variables.
REAL(KIND=JPRB),POINTER:: SPQ(:,:)                 ! Specific humidity.
REAL(KIND=JPRB),POINTER:: SPO3(:,:)                ! Ozone.
REAL(KIND=JPRB),POINTER:: SPL(:,:)                 ! Liquid water.
REAL(KIND=JPRB),POINTER:: SPI(:,:)                 ! Ice.

REAL(KIND=JPRB),POINTER:: SP5GFL(:,:,:)            ! GFL variables.
REAL(KIND=JPRB),POINTER:: SP5Q(:,:)                ! Specific humidity.
REAL(KIND=JPRB),POINTER:: SP5O3(:,:)               ! Ozone.
REAL(KIND=JPRB),POINTER:: SP5L(:,:)                ! Liquid water.
REAL(KIND=JPRB),POINTER:: SP5I(:,:)                ! Ice.

! -   Splitting of the array SPA2

! === 2D dyn. fields and surface pressure ===
REAL(KIND=JPRB),POINTER:: SPD2D(:,:)               ! 2D variables.
REAL(KIND=JPRB),POINTER:: SPSP(:)                  ! Log of surface pressure.

REAL(KIND=JPRB),POINTER:: SP5D2D(:,:)              ! 2D variables.
REAL(KIND=JPRB),POINTER:: SP5SP(:)                 ! Log of surface pressure.

! === etadot dprehyd/deta (used in ALADIN) ===
REAL(KIND=JPRB),POINTER:: SPEVELT1(:)              ! etadot dprehyd/deta.
REAL(KIND=JPRB),POINTER:: SP5VELT1(:)              ! etadot dprehyd/deta.

! === Boundary conditions ===
REAL(KIND=JPRB),POINTER:: SPC2D(:,:)               ! boundary data.
REAL(KIND=JPRB),POINTER:: SPOR(:)                  ! surface orography.

! -   Splitting of the array SPA1,SP5A1

REAL(KIND=JPRB),POINTER:: SPUB(:)                  ! mean value of U.
REAL(KIND=JPRB),POINTER:: SPVB(:)                  ! mean value of V.
REAL(KIND=JPRB),POINTER:: SP5UB(:)                 ! mean value of U.
REAL(KIND=JPRB),POINTER:: SP5VB(:)                 ! mean value of V.

!     ------------------------------------------------------------------
END MODULE YOMSP
