MODULE YOMNMIA

USE PARKIND1  ,ONLY : JPIM     ,JPRB

IMPLICIT NONE

SAVE

!     ------------------------------------------------------------------
!*    Normal Mode Initialization control (YOMNMI part A)

! ----------  ARRAYS : ------------------
!  FILTR :  cut-off adim. array of frequencies defining Rossby modes :
!           |FREQ| < FILTR(KVMO). Each vertical mode should have a different
!           cut-off value, also depending on the number of vertical modes of
!           the model (determining different values of equivalent height).

! ----------  GENERAL CONTROLS ----------
!  NITNMI  : number of required iterations of non linear normal mode init.

!  NVMOD   : NUMBER OF VERTICAL MODES (MULTI-LEVEL MODEL)
!  NVMODM  : MAXIMUM NUMBER OF VERTICAL MODES TO BE USED (NMI uses
!            NVMOD modes but 3D-var uses NVMODF, for example)
!  NVMODPP : NUMBER OF VERTICAL MODES ON THIS PE (DISTRIBUTED MEMORY)

!  ------------- Variational analysis options ---------------
!  The following switches are controlled by the internal switch
!  LFLTBAL, and are used by 3D/4D var for filtering.
!  IF LFLTBAL=.FALSE. (the normal case for NMI) they have no effect.

!  NVMODF : For vertical modes 1 through NVMODF, Hough modes used
!           will be those associated with that vertical mode.
!           Beyond NVMODF the Hough modes associated with NVMODF will
!           be used for all further modes: NVMODF+1 through to NVMOD.
!  NVMODF1: Projection amplitudes for vertical modes 1 through NVMODF1
!           will take their full values.
!           Projection amplitudes will be linearly reduced between their
!           full values at NVMODF1 and zero at NVMODF2.
!  NVMODF2: Projection amplitudes at NVMODF2 and beyond are set to zero.
!  NVMODJB: Number of vertical modes used for Jb (NVMODJB = NVMODF2-1)
!  NVMODJBPP: Number of vertical modes used for Jb on this PE
! -------------------------------------------------------------------

!  NLEX  :  Total Wavenumber beyond which implicit NMI is carried out

! ----------  LOGICAL SWITCHES  ---------
! **** general ****
!  LNOINI:  TRUE provided nothing relative to initialization is required :
!                LNMIRQ = LJCNMI = LNPROJ = LCONMO = FALSE
!  LNMIRQ:  TRUE if normal mode initialization  required
!  LNMI :  TRUE if linear normal mode init. req.
!  LNLNMI:  TRUE if non-linear normal mode init. req.
!  LRPIMP:  TRUE for partially implicit initialization
!  LTRANS:  TRUE if NMI req. on TRANSFORMED sphere (otherwise on GEOGRAPHIC)
!  LSPNDG:  TRUE if NMI spectral diagnostics req. (CALL SPNORM)
!  LRGENE:  TRUE if NMI energy diagnostics req. (energy in grav. components)
!  LRSPSL:  TRUE for restoring surface pressure after all but last iteration.
!  LICONV:  if TRUE, another, dummy, iteration is performed to test convergence
!  LNMIFF:  TRUE if frequency filtering is used in initialization
!  LASSI  : TRUE if adiabatic NMI of small scales only (after interpolation
!                   of [3DVAR] analysis to lower resolution)
!  LSTDNMI  switch for standard NMI, (viaCNMI;)
! **** options ****
!  LCONMO : TRUE to compute explicit normal modes ; if FALSE , arrays are read
!           on files, unless LRPIMP=.TRUE. and NLEX=0 (pure implicit scheme)
!  LCOIMP : TRUE if the IMPLICIT NMI help arrays         must be computed.
!  LCOTYGR: TRUE if the subset of Gravity/Rossby index   must be computed.
!  LNMIPR : TRUE if the frequencies of explicit modes must be printed

!  ---------   THE FOLLOWING OPTIONS ARE FOR DIAGNOSTIC PURPOSES ------
!                  TO USE, SET LNMIRQ = .FALSE.
!  LNPROJ:  TRUE for projection of fields onto normal modes
!  LRPROJ:  TRUE for projection of fields onto Rossby modes
!  LGPROJ:  TRUE for projection of fields onto inertia-gravity modes
!  LFLTBAL  TRUE for specific Hough filtering for variational analysis
!                see also NVMODF, NVMODF1, NVMODF2
!    The number of vertical modes to project onto can be controlled
!    by NVMOD (see above).

REAL(KIND=JPRB) :: FILTR(50)

INTEGER(KIND=JPIM) :: NLEX
INTEGER(KIND=JPIM) :: NITNMI
INTEGER(KIND=JPIM) :: NVMODF
INTEGER(KIND=JPIM) :: NVMODF1
INTEGER(KIND=JPIM) :: NVMODF2
INTEGER(KIND=JPIM) :: NVMODM
INTEGER(KIND=JPIM) :: NVMOD
INTEGER(KIND=JPIM) :: NFILTM
INTEGER(KIND=JPIM) :: NVMODPP
INTEGER(KIND=JPIM) :: NVMODJB
INTEGER(KIND=JPIM) :: NVMODJBPP
LOGICAL :: LNMIRQ
LOGICAL :: LNMI
LOGICAL :: LNLNMI
LOGICAL :: LSTDNMI
LOGICAL :: LRPIMP
LOGICAL :: LNPROJ
LOGICAL :: LRPROJ
LOGICAL :: LGPROJ
LOGICAL :: LFLTBAL
LOGICAL :: LTRANS
LOGICAL :: LSPNDG
LOGICAL :: LRGENE
LOGICAL :: LRSPSL
LOGICAL :: LCONMO
LOGICAL :: LCOIMP
LOGICAL :: LCOTYGR
LOGICAL :: LNOINI
LOGICAL :: LICONV
LOGICAL :: LNMIPR
LOGICAL :: LNMIFF
LOGICAL :: LASSI

!     ------------------------------------------------------------------
END MODULE YOMNMIA
