MODULE YOMCVA

USE PARKIND1  ,ONLY : JPIM

USE CONTROL_VECTORS

IMPLICIT NONE
SAVE

!     ------------------------------------------------------------------
!      YOMCVA

! NVA3SP        : Number of 3D fields in the control vector which
!                 are spectral fields in the model (ie in SPA3).
! NVA3GP        : Number of 3D fields in the control vector which
!                 are grid point fields in the model (ie in GPUABUF).
! NVA3D         : Total number of 3D fields in the control vector
!                 (ie NVA3D=NVA3SP+NVA3GP).
! NVA2D         : Total number of 2D fields in the control vector.
! NVA1D         : Dimension of LAM Aladin mean wind components in ctl vec
! NVATOV        : DIMENSION OF TOVS CONTOL VARIABLE (part of NVADIM)
! NVATOVV       : NUMBER OF TOVS CONTOL VARIABLES 
! NVAPARAM      : Number of scalar parameters in control variable
! NGRBVAR       : Grib codes of fields in control variable

INTEGER(KIND=JPIM) :: NVA3SP
INTEGER(KIND=JPIM) :: NVA3GP
INTEGER(KIND=JPIM) :: NVA3D
INTEGER(KIND=JPIM) :: NVA2D
INTEGER(KIND=JPIM) :: NVA1D
INTEGER(KIND=JPIM) :: NVATOV
INTEGER(KIND=JPIM) :: NVATOVV
INTEGER(KIND=JPIM) :: NVAPARAM
INTEGER(KIND=JPIM), ALLOCATABLE :: NGRBVAR(:)

! * CONTROL_VECTOR variables:
!   YVAZX           : control variable
!   YVAZG           : gradient of control variable
!   YSCALP          : scalar product array
!   YRSCALP         : inverse of YSCALP
!   YSCALPSQRT      : squared root of YSCALP
!   YRSCALPSQRT     : inverse of YRSCALP
#ifdef RS6K
TYPE(CONTROL_VECTOR), SAVE :: YVAZX  ! SAVE is already the default for the
TYPE(CONTROL_VECTOR), SAVE :: YVAZG  ! module but the IBM compiler complains.
TYPE(CONTROL_VECTOR), SAVE :: YVAZ0
TYPE(CONTROL_VECTOR), SAVE :: YSCALP
TYPE(CONTROL_VECTOR), SAVE :: YRSCALP
TYPE(CONTROL_VECTOR), SAVE :: YSCALPSQRT
TYPE(CONTROL_VECTOR), SAVE :: YRSCALPSQRT
#else
TYPE(CONTROL_VECTOR) :: YVAZX
TYPE(CONTROL_VECTOR) :: YVAZG
TYPE(CONTROL_VECTOR) :: YVAZ0
TYPE(CONTROL_VECTOR) :: YSCALP
TYPE(CONTROL_VECTOR) :: YRSCALP
TYPE(CONTROL_VECTOR) :: YSCALPSQRT
TYPE(CONTROL_VECTOR) :: YRSCALPSQRT
#endif

!     ------------------------------------------------------------------
END MODULE YOMCVA
