!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer,
!                     version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer
!version 3 or (at your option) any later version that should be found at:
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software;
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec),
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
!

      SUBROUTINE SUMODE(KULOUT) 1,2
#if defined (DOC)
*
***s/r SUMODE * - Setting up the dimensions and parameters
*                 necessary to compute the normal modes.
*                 Then compute normal mode projectors.
*                 SUMODE is called only for CVCORD.ne.'PRESS'
*     --------
*
*Author: L. Fillion *RPN/AES  Nov 93
*
*Revision: L. Fillion *RPN/AES  Oct 96
*            - Strict use of VLEV to prepare the normal-modes
*              and projection operators. Replace NSIGLEV and SIGHOF
*              by NFLEV and VLEV. This is used only for non-pressure coordinates.
*            - Remove print of namelist (this is done at a higher-level now)
*Revision: L. Fillion *ARMA/AES  Sep 98
*            - Call matapat using a different exponent
*Revision: L. Fillion *ARMA/AES  10 mar 99
*            - Remove initialization by matapat
*Revision: L. Fillion *ARMA/EC  27 Apr 2007 & May 2010 (implementation into v_11_01b).
*            - Initialize NL and TL timesteps for INMI.
*
*
*     Purpose: initialize  COMODE.
*
*Arguments:
*     i: KULOUT  (logical unit for optional printing i.e. debugging)
*     o: comode.cdk (COMDECK containing the required information to
*                    compute the normal modes)
*
#endif
C
*implicits
      IMPLICIT NONE
#include "comdim.cdk"
#include "comode.cdk"
C
      INTEGER KULOUT, JLEV, IERR
C
*modules
      EXTERNAL MATAPAT, NMODES
*
**
      WRITE(UNIT=KULOUT,FMT='(//,'' ****************************'')')
      WRITE(UNIT=KULOUT,FMT='('' SET NORMAL MODE PROJECTORS :'')')
      WRITE(UNIT=KULOUT,FMT='('' ****************************'')')
C
C*1.  SET DEFAULT VALUES AND MODIFY THEM.
C     -----------------------------------
C
 100  CONTINUE
C
C*    1.1 DEFAULT VALUES
C     ------------------
 110  CONTINUE
      LMOD     = .TRUE.
      LPRTMOD  = .TRUE.
      LWRTMOD  = .FALSE.
      MHEMMOD  = 0
      MTYPMOD  = 2
      TSTAR    = 300.0
      ALPHA    = 2.0
      NVMOD    = 3
      XPLIM    = 48.0
      BRTPHGT  = 5000.
      delt_nl  = 1350.
      delt_tl  = 1350.
C
C*    1.2 READ NAMELIST
C     -----------------
 120  CONTINUE
      WRITE(UNIT=KULOUT,FMT='(//,'' MODIFICATION OF DIMENSIONS:''
     S     ,''- reading the namelist NAMODE in SUMODE'')')
C
      CALL READNML('NAMODE',IERR)
C
C*    2. INITIALIZATION OF Mean temperature profile for normal modes
C     --------------------------------------------------------------
C
 200  CONTINUE
      DO 210 JLEV = 1, NFLEV
         TMEANH(JLEV) = TSTAR
 210  CONTINUE
C
C*    3. PREPARE MATRICES FOR NORMAL MODE PROJECTION
C     -------------------------------------------
C
 300  CONTINUE
      IF(NFLEV.GT.1) THEN
         CALL NMODES
      END IF
C
C
      RETURN
      END