C Copyright 1981-2012 ECMWF.
C
C This software is licensed under the terms of the Apache Licence 
C Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
C
C In applying this licence, ECMWF does not waive the privileges and immunities 
C granted to it by virtue of its status as an intergovernmental organisation 
C nor does it submit to any jurisdiction.
C

       PROGRAM TDEXP
C
C**** *TDEXP*
C
C
C     PURPOSE.
C     --------
C         Expands list of Bufr data descriptors.
C
C
C**   INTERFACE.
C     ----------
C
C          NONE.
C
C     METHOD.
C     -------
C
C          NONE.
C
C
C     EXTERNALS.
C     ----------
C
C         CALL BUSEL
C         CALL BUFREX
C         CALL BUFREN
C         CALL BUPRS0
C         CALL BUPRS1
C         CALL BUPRS2
C         CALL BUPRS3
C         CALL BUPRT
C         CALL BUUKEY
C
C     REFERENCE.
C     ----------
C
C          NONE.
C
C     AUTHOR.
C     -------
C
C          M. DRAGOSAVAC    *ECMWF*       June 2005.
C
C
C     MODIFICATIONS.
C     --------------
C
C          NONE.
C
C
      IMPLICIT LOGICAL(L,O,G), CHARACTER*8(C,H,Y)
C
      PARAMETER(JSEC1=40,JSEC3=4)
      PARAMETER (KDLEN=200,KELEM=40000,KVALS=360000)
C 
      DIMENSION KSEC1(JSEC1)     ! ,KSEC3(JSEC3)
C
      DIMENSION KTDLST(KELEM),KTDEXP(KELEM)
      DIMENSION KDATA(KDLEN)
C
      CHARACTER*64 CNAMES(KELEM)
      CHARACTER*24 CUNITS(KELEM)
C                                                                       
C
C     ------------------------------------------------------------------
C*          1. INITIALIZE CONSTANTS AND VARIABLES.
C              -----------------------------------
 100  CONTINUE
C
C
      RVIND=1.7E38
C
C     INITIALIZE DELAYED REPLICATION FACTORS OR REFERENCE VALUES ETD.
C
C
      KDATA(1)=127
      KDATA(2)=5
      KDATA(3)=5
      KDATA(4)=5
      KDATA(5)=5
C
C     SET DATA DECSRIPTORS
C
      KTDLST(  1)=301090
      KTDLST(  2)=301091
      KTDLST(  3)=302001
      KTDLST(  4)=007004
      KTDLST(  5)=010009
      KTDLST(  6)=302072
      KTDLST(  7)=101005
      KTDLST(  8)=307063
      KTDLST(  9)=302069
      KTDLST( 10)=007032
      KTDLST( 11)=007033
      KTDLST( 12)=020031
      KTDLST( 13)=020032
      KTDLST( 14)=002038
      KTDLST( 15)=022043
      KTDLST( 16)=302021
      KTDLST( 17)=302078
      KTDLST( 18)=302073
      KTDLST( 19)=302074
      KTDLST( 20)=302075
      KTDLST( 21)=004025
      KTDLST( 22)=302076
      KTDLST( 23)=302071
      KTDLST( 24)=004025
      KTDLST( 25)=013059
      KTDLST( 26)=302083
      KTDLST( 27)=033005
      KTDLST( 28)=033006

      KTDLST( 29)=223000
      KTDLST( 30)=236000
      KTDLST( 31)=101000
      KTDLST( 32)=031001
      KTDLST( 33)=031031
      KTDLST( 34)=001031
      KTDLST( 35)=001032
      KTDLST( 36)=008083
      KTDLST( 37)=101000
      KTDLST( 38)=031001
      KTDLST( 39)=223255

      KTDLST( 40)=223000
      KTDLST( 41)=237000
      KTDLST( 42)=001031
      KTDLST( 43)=001032
      KTDLST( 44)=008083
      KTDLST( 45)=101000
      KTDLST( 46)=031001
      KTDLST( 47)=223255

      KTDLST( 48)=223000
      KTDLST( 49)=237000
      KTDLST( 50)=001031
      KTDLST( 51)=001032
      KTDLST( 52)=008083
      KTDLST( 53)=101000
      KTDLST( 54)=031001
      KTDLST( 55)=223255

      KTDLST( 56)=223000
      KTDLST( 57)=237000
      KTDLST( 58)=001031
      KTDLST( 59)=001032
      KTDLST( 60)=008083
      KTDLST( 61)=101000
      KTDLST( 62)=031001
      KTDLST( 63)=223255



      ktdlen=63

C
C     SET DATA DECSRIPTORS
C
C     SECTION 1 CONTENT
C
      KSEC1(2)=4     ! BUFR EDITION NUMBER
      KSEC1(14)=0    ! BUFR MASTER TABLE USED
      ksec1(16)=0    ! ORIGINATING SUB-CENTRE
      KSEC1(3)=98    ! ORIGINATING CENTRE
      KSEC1(8)=1     ! VERSION NUMBER OF LOCAL TABLE USED
      KSEC1(15)=12    ! VERSION NUMBER OF MASTER TABLE USED
C
C     SECTION 3 CONTENT
C
C
c
      K=1
      CALL BUXDES(K,KSEC1,KTDLEN,KTDLST,KDLEN,KDATA,KELEM,
     1            KTDEXL,KTDEXP,CNAMES,CUNITS,KERR)
C
      END
