!-------------------------------------- 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 SULUN 1,1
#if defined (DOC)
C
C**** *SULUN * - Routine to initialize all logical units
*
C     Author: P. Gauthier *ARMA/AES  June 9, 1992
*
*Revision:
*     .   P. Koclas  *CMC/CMSV   January 1997
*                  - Call to SUFILNAM to initialize file names and open them
*     .   J. St-James  *CMC/CMSV   June 1997
*                  - Call to SUFILNAM instead of naming and opening the
*                    laloobs file.
*     .   S. Pellerin *ARMA/AES March 2000
*                  - Add of nulstato for ouput background statistics
*     .   S. Pellerin *ARMA/SMC May 2000
*                  - Logical unit cleanup
*    .    Bin He    *ARMA/MSC    Apr. 2008. 
*                  - Reading multiple trial files . 
*     .   S. Pellerin, ARMA, August 2008
*                  - initialisation on ninmpg for dynamic assignation
*                    of logical unit
*     .   L. Fillion, ARMA, 7 August 2009
*                  - Introduce nutemp via comlunla.cdk
c 
c 
c 
*     ---------------------------------------------------------------------
#endif
      IMPLICIT NONE
#include "comlun.cdk"
#include "comlunla.cdk"
C
      INTEGER IERR, FNOM, FSTOUV, JFILE
      EXTERNAL FNOM, FSTOUV
C
C        1.    Initialize COMLUN.
C              ------------------
C
 100  CONTINUE
      NULOUT =  6
      NULNAM =  0
      NULSTAT = 0
      NULBGST = 0
      NTRIALS=1 
      NULSTD  = 0
      NULINCLR=0
      NULINCHR=0
      ninmpg = 0
      nutemp = 700
C
      CALL SUFILNAM
c
      WRITE(UNIT=NULOUT,FMT=9000)nulout,nulnam,ninmpg,nulstat,nulbgst
     &     ,nulstd,nulinclr,nulinchr
 9000 FORMAT(//,6X,"SULUN- ASSIGNMENTS OF VARIATIONAL LOGICAL UNITS",/
     S     ,10X,' NULOUT = ',I3,' NULNAM  = ',I3/
     S     ,10X,' NINMPG = ',I3,' NULSTAT = ',I3,' NULBGST = ',I3
     S     ,10X,' NULSTD = ',I3,' NULINCLR = ',I3,' NULINCHR = ',I3)
C
C     ---------------------------------------------------------------
C
      RETURN
      END