!-------------------------------------- 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 GETINCR(KULSTAT,KFILE) 13,2
#if defined (DOC)
*
***s/r GETINCR  - Access of a file containing a set of
*     .           normalized increments
*
*
*Author  : P. Gauthier *ARMA/AES  August 12, 1994
*Revision:
*
*    -------------------
**    Purpose: to access a file of normalized increments contained
*     .        in a RPN standard file
*     .
*Arguments
*     KULSTAT: logical unit on which the file is located
*     KFILE  : number of the file
*
*     Remark: the parameters that define the files and their content
*     ------  are within COMCSE1 and controlled by the corresponding
*     .       namelist NAMCSE1. The way the file is accessed is controlled
*     .       as usual through COMGDPAR
#endif
      IMPLICIT NONE
*implicits
#include "comlun.cdk"
#include "comgdpar.cdk"
#include "comcse1.cdk"
*
      INTEGER KULSTAT, KFILE
C
      INTEGER IFLAG
      INTEGER IERR
C
      INTEGER FNOM, FSTOUV
      CHARACTER*1 CLTYP
C
C*    1. Open the file
C
 100  CONTINUE
C
      WRITE(NULOUT,9100) KFILE
      WRITE(NULOUT,*) CFLNAMES(KFILE)
 9100 FORMAT(//,10X,"GETINCR: Processing File No. ",I4,/,15X,
     S     "-- Reading normalized increments from  the file: ")
C
      IERR = FNOM(KULSTAT,CFLNAMES(KFILE),'RND',0)
      IF(IERR.GE.0)THEN
         IERR =  FSTOUV(KULSTAT,'RND')
      ELSE
         CALL ABORT3D(NULOUT,'CSE1  ')
      END IF
C
C*    2. Read the NAMELIST NAMGDPAR
C
 200  CONTINUE
      NSTAMPA = 0
      NSTAMPT =0
      NSTAMPI =0
      NSTAMPN =0
C
      CETIKETA = ' '
      CETIKETT = ' '
      CETIKETI = ' '
      CETIKETN = ' '
C
      NITER = 0
      CMCRUN = ' '
      NFSTVAR = 0
      CFSTVAR(1) = ' '
      CFSTVAR(2) = ' '
      CFSTVAR(3) = ' '
      CFSTVAR(4) = ' '
      CFSTVAR(5) = ' '
      CFSTVAR(6) = ' '
      CFSTVAR(7) = ' '
C
      CALL READNML('NAMGDPAR',IFLAG)
C
C*    3. Check the file containing the normalized increments
C
 300  CONTINUE
C
C      IKEY =FSTINF(KULSTAT,INI,INJ,INK
C     S     ,NSTAMPN,CETIKETN,-1,-1,-1,' ',' ')
C      IERR = FSTPRM(IKEY,IDATET,IDT,IPAS,INI,INJ,INK,IBITS,IDTYP,
C     +     IP1,IP2,IP3,CLTYP,CLNOM,CLETIKET,CLGR,IG1,IG2,IG3,IG4,
C     +     ISWA,ILNG,IDLTF,IUBC,IX1,IX2,IX3)
C      IF(IERR.LT.0) THEN
C         WRITE(NULOUT,9300)IKEY, IERR, CFLNAMES(KFILE)
C         CALL ABORT3D(NULOUT,"ERROR IN GETINCR")
C      END IF
 9300 FORMAT(///,20("*"),/,5X,"IKEY = ",I10,4X,"IERR = ",I6
     S     ,/,5X,"VERIFY THE CONSISTENCY OF COMGDPAR"
     S     ," WITH THOSE OF THE FILE ",A8)
C
      CTYPVARN = ' '
C
      RETURN
      END