SUBROUTINE IFSODBDDR1F(KSLOT  ,&
 & KCMDDR1,&
 & KNDATRE,KMXDRL ,KMXCRL ,KNOOBS ,&
 & KNOSYNO,KNOAIRE,KNOSATO,KNODRIB,&
 & KNOTEMP,KNOPILO,KNOSTNR,KNOSTRA,KNOSTRAA,&
 & KNOPAOB,KNOSCAT,KNOLIMB,KNOSSMI,KNOREO3,&
 & KCMALEN                                  )  

!**** SUBROUTINE IFSODBDDR1F - FULL MODIFICATION OF ODB FIRST DDR

!        D. VASILJEVIC     ECMWF    30/08/1994

!     PURPOSE
!     -------

!        FULL MODIFICATION OF ODB FIRST DDR

!**   INTERFACE
!     ---------

!        CALL IFSODBDDR1F(KSLOT  ,
!                         KCMDDR1,
!                         KNDATRE,KMXDRL ,KMXCRL ,KNOOBS ,
!                         KNOSYNO,KNOAIRE,KNOSATO,KNODRIB,
!                         KNOTEMP,KNOPILO,KNOSTNR,KNOSTRA,KNOSTRAA,
!                         KNOPAOB,KNOSCAT,KNOLIMB,KNOSSMI,KNOREO3,
!                         KCMALEN                                  )
!     WHERE:
!           KSLOT   = TIME SLOT INDEX
!           KCMDDR1 = ODB DDR1
!           KNDATRE =
!           KMXDRL  =
!           KMXCRL  =
!           KNOOBS  =
!           KNOSYNO = NO. OF SYNOPS
!           KNOAIRE = NO. OF AIREPS
!           KNOSATO = NO. OF SATOBS
!           KNODRIB = NO. OF DRIBUS
!           KNOTEMP = NO. OF TEMPS
!           KNOPILO = NO. OF PILOTS
!           KNOSTNR = NO. OF SATEMS (NON-RADIANCE)
!           KNOSTRA = NO. OF SATEMS (TOVS RADIANCE)
!           KNOSTRAA= NO. OF SATEMS (LEVEL-1C/GEOS RADIANCE)
!           KNOPAOB = NO. OF PAOBS
!           KNOSCAT = NO. OF SCATS
!           KNOLIMB = NO. OF LIMB OBS
!           KNOSSMI = NO. OF SSMIs/TRMMs
!           KNOREO3 = NO. OF RETRIEVED OZONE LAYER OBS.
!           KCMALEN =

!        IFSODBDDR1F IS CALLED BY OBADAT

!     METHOD
!     ------

!        ODB FIRST DDR IS MODIFIED

!     EXTERNALS
!     ---------

!     MODIFICATIONS
!     -------------
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        Niels Bormann 23-Dec-2004 RARAD becomes LIMB

!-----------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

USE YOMCMA
USE YOMCMDDR
USE YOMMKODB
USE YOMANCS  , ONLY : NMDI     ,NMINPHOU ,&
 & NSECPMIN ,NDAYFINH   
USE YOMCT0   , ONLY : LSCREEN, LCANARI
USE YOMLUN   , ONLY : NULOUT

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KSLOT 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KCMDDR1(NMXDCL) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNDATRE 
INTEGER(KIND=JPIM),INTENT(IN)    :: KMXDRL 
INTEGER(KIND=JPIM),INTENT(IN)    :: KMXCRL 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOOBS 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSYNO 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOAIRE 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSATO 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNODRIB 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOTEMP 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOPILO 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSTNR 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSTRA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSTRAA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOPAOB 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSCAT 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOLIMB 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOSSMI 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNOREO3 
INTEGER(KIND=JPIM),INTENT(IN)    :: KCMALEN 
!-----------------------------------------------------------------------

!-----------------------------------------------------------------------

!CHARACTER (LEN = 1) :: CL_1H = ' '

INTEGER(KIND=JPIM) :: itime(8)

INTEGER(KIND=JPIM) ::   JRES, JPR

REAL(KIND=JPRB) :: ZHOOK_HANDLE

!-----------------------------------------------------------------------

!*

IF (LHOOK) CALL DR_HOOK('IFSODBDDR1F',0,ZHOOK_HANDLE)
WRITE(NULOUT,FMT='('' ***  IFSODBDDR1F ***'')')
WRITE(NULOUT,'('' '',5(i10,1x))') KSLOT  ,&
 & KNDATRE,KMXDRL ,KMXCRL ,KNOOBS  
WRITE(NULOUT,'('' '',14(i5,1x))') KNOSYNO,KNOAIRE,KNOSATO,KNODRIB,&
 & KNOTEMP,KNOPILO,KNOSTNR,KNOSTRA,KNOSTRAA,&
 & KNOPAOB,KNOSCAT,KNOLIMB,KNOSSMI,KNOREO3  
WRITE(NULOUT,'('' '',i10)') KCMALEN 

WRITE (NULOUT,'('' ddr 1 in '')')
DO JPR = 1 , 1024
  WRITE (NULOUT,'('' '',i4,1x,i10)') JPR,KCMDDR1(JPR)
ENDDO

!                 FIRST ODB DDR FORMAT (INTEGER SECTION)
!                 --------------------------------------

!*          1.1   FIRST DDR LEN.; LOOKS OK (=3072)

!KCMDDR1(NCD1LN )=  NLENCD1

!*          1.2   NO. OF NON INTEGER SECTIONS; NOT GOOD (=0)

KCMDDR1(NCD1NIS)=  2

!*          1.3   TYPE OF FIRST NON INTERGER SECTION; NOT GOOD (=0)

!KCMDDR1(NCD1TF )=  NREALSC ! NREALSC not defined yet
KCMDDR1(NCD1TF )=  2

!*          1.4   TYPE OF SECOND NON INTERGER SECTION; NOT GOOD (=0)

!KCMDDR1(NCD1TS )=  NCHARSC ! NCHARSC not defined yet
KCMDDR1(NCD1TS )=  3

!*          1.5   LEN. OF INTERGER SECTION; NOT GOOD (=0)

KCMDDR1(NCD1IL )=  NLEND1I  ! (=1024)

!*          1.6   LEN. OF FIRST NON INTERGER SECTION; NOT GOOD (=0)

KCMDDR1(NCD1LFS)=  NLEND1R  ! (=1024)

!*          1.7   LEN. OF SECOND NON INTERGER SECTION; NOT GOOD (=0)

KCMDDR1(NCD1LSS)=  NLEND1C  ! (=1024)

!*          1.8   LEN. OF NEXT DDR; NOT GOOD  (=0)

KCMDDR1(NCD1NL )=  NLENCD2 ! (=3072)

!*          1.9   CREATION TIME; LOOKS OK

!--   Thanks to a hint provided by Jean-Francois Estrade (Wed, 24 Sep 97 16:24)
CALL DATE_AND_TIME (values=ITIME)

!     CALL CLOCK(ZTIME )
!     WRITE(CLTIM  ,'(A8)') ZTIME
!     CLTIME            =  CLTIM  (1:2)//CLTIM  (4:5)//CLTIM  (7:8)
!     READ(CLTIME ,'(I6)') ICRETIM

!ICRETIM=ITIME(5)*10000+ITIME(6)*100+ITIME(7)
!`KCMDDR1(NCD1CT ) = ICRETIM

!*          1.10  CREATION DATE; LOOKS OK

!     CALL DATE(ZDATE)
!     WRITE(CLDAT  ,'(A8)') ZDATE
!     CLDATE            =  CLDAT  (7:8)//CLDAT  (1:2)//CLDAT  (4:5)
!     READ(CLDATE ,'(I6)') ICREDAT
!     IF(ICREDAT/10000.GT.NCENYEAL)     THEN
!       KCMDDR1(NCD1CD ) = nCURCEN*10000 + ICREDAT
!     ELSE
!       KCMDDR1(NCD1CD ) = NNEXCEN*10000 + ICREDAT
!     ENDIF

!ICREDAT=ITIME(1)*10000+ITIME(2)*100+ITIME(3)
!KCMDDR1(NCD1CD ) = ICREDAT

!*          1.11  TIME OF THE MIDDLE OF OBS. PERIOD

!KCMDDR1(NCD1OT )=  NANTIM   ! looks OK in SCREENING, but not in minimisation
!                            ! (NANTIM not in IFS)
! SET IT TEMPORARY TO 12Z for non screening run
!IF(.NOT.LSCREEN) THEN
!  KCMDDR1(NCD1OT )= 120000
!ENDIF

!*          1.12  DATE OF THE MIDDLE OF OBS. PERIOD

!KCMDDR1(NCD1OD )=  NANDAT   ! looks OK in SCREENING, but not in minimisatio
!                            ! (NANDAT not in IFS)
! SET IT TEMPORARY TO 20010101 for non screening run
!IF(.NOT.LSCREEN) THEN
!  KCMDDR1(NCD1OD )=  20010101
!ENDIF

!*          1.13  NO. OF SEC. PER TIME UNIT; NOT GOOD (=0)

KCMDDR1(NCD1NS )=  NSECPMIN ! (=60)

!*          1.14  LEN. OF OBS. PERIOD IN TIME UNITS; NOT GOOD (=0)

IF(LSCREEN) THEN
  IF(L3DVAR)    THEN                         !
    KCMDDR1(NCD1OP )=  NDAYFINH * NMINPHOU   !
  ELSE                                       !  TO BE DEALT WITH (not right)
    KCMDDR1(NCD1OP )=  N4DMIN                !
  ENDIF                                      !
ENDIF

!*          1.15  NO. OF PLANNED UPDATES

!KCMDDR1(NCD1NPU)=  NRESUPD                 !  LOOKS OK IN SCREENING, BUT NOT
                                            !  IN MINIMISATION
                                            !  TO BE DEALT WITH
! SET IT TEMPORARY TO 2 for non screening run
!IF(.NOT.LSCREEN) THEN
!  KCMDDR1(NCD1NPU)=  2
!ENDIF

!*          1.16  NO. OF PERFORMED UPDATES

!     KCMDDR1(NCD1NUP)=  0
!     KCMDDR1(NCD1NUP)=  NUSDUPD
KCMDDR1(NCD1NUP)= -1
IF(.NOT.LSCREEN) THEN
  KCMDDR1(NCD1NUP)= 0
ENDIF

!*          1.17  NO. OF ADDITIONAL DEPATRURES

!KCMDDR1(NCD1AD )=  NODEPT                  !  TO BE DEALT WITH

!*          1.18  NO. OF DDRS               !  looks ok

!KCMDDR1(NCD1ND )=  NMXDDRS

!*          1.19  NO. OF DATA RECORDS; LOOK OK

!KCMDDR1(NCD1DR )=  KNDATRE

!*          1.20  MAX. LEN. OF DDR

!KCMDDR1(NCD1LD )=  NMXDCL                  !  looks ok

!*          1.21  MAX. LEN. OF DATA REC.    !  looks ok

!KCMDDR1(NCD1MR )=  KMXDRL

!*          1.22  MAX. LEN. OF CMA REPORT   !  looks ok

!KCMDDR1(NCD1RM )=  KMXCRL

!*          1.23  TOTAL NO. OF CMA FILES    !  looks ok

!KCMDDR1(NCD1NF )=  NOCMA 

!*          1.24  CMA FILE SQ. NO.          !  looks ok

!KCMDDR1(NCD1SQ )=  KSLOT

!*          1.25  NO. OF TIME SLOTS

!KCMDDR1(NCD1TM )=  NOTSL                   ! LOOKS OK IN SCREENING, BUT
!                                             NOT IN MINIM
! SET IT TEMPORARY TO 7 for non screening run
!IF(.NOT.LSCREEN) THEN
!  KCMDDR1(NCD1TM )= 7
!ENDIF

!*          1.26  MAX. NO. OF OBS. TYPES    ! LOOKS OK

!KCMDDR1(NCD1MOT)=  NMXOTP

!*          1.27  TOTAL NO. OF OBS.         ! LOOKS OK

KCMDDR1(NCD1TO )=  KNOOBS

!*          1.28  NO. OF SYNOP OBS. ! LOOKS OK

!KCMDDR1(NCD1NSY)=  KNOSYNO

!*          1.29  NO. OF AIREP OBS.

KCMDDR1(NCD1NAI)=  KNOAIRE

!*          1.30  NO. OF SATOB OBS.

KCMDDR1(NCD1NSA)=  KNOSATO

!*          1.31  NO. OF DRIBU OBS.

KCMDDR1(NCD1NDB)=  KNODRIB

!*          1.32  NO. OF TEMP OBS.

KCMDDR1(NCD1NTE)=  KNOTEMP

!*          1.33  NO. OF PILOT OBS.

KCMDDR1(NCD1NPI)=  KNOPILO

!*          1.34  NO. OF SATEM (NON-RADIANCE) OBS.

KCMDDR1(NCD1NSM)=  KNOSTNR

!*          1.35  NO. OF SATEM (RADIANCE) OBS.

KCMDDR1(NCD1NT )=  KNOSTRA

!*          1.36  NO. OF PAOB OBS.

KCMDDR1(NCD1NPA)=  KNOPAOB

!*          1.37  NO. OF SCATT. OBS.

KCMDDR1(NCD1SC )=  KNOSCAT

!*          1.38  NO. LIMB OBS.

KCMDDR1(NCD1NLM)=  KNOLIMB

!*          1.39  NO. OF SSMI/TRMM OBS.

KCMDDR1(NCD1NSSM)= KNOSSMI

!*          1.40  NO. OF LEVEL-1C/GEOS OBS.

KCMDDR1(NCD1NAT )= KNOSTRAA

!*          1.41  NO. OF RETRIEVED OZONE LAYERS OBS.

KCMDDR1(NCD1NRO3)= KNOREO3

!*          1.42  42-50 RESERVED ! NOT GOOD (=0)

DO JRES = 42 , 50
  KCMDDR1(JRES   )=  NMDI
ENDDO

!*          1.51  TOTAL LENGTH OF CMA ! LOOKS GOOD

!KCMDDR1(NCD1AL )= KCMALEN

!*          1.52  TYPE OF ANAL. (OI/VARIATIONAL/ETC.) ! to be looked at (set
!                  miss)

KCMDDR1(NCD1TVA)   =  NMDI
IF(LCANARI)     THEN
  KCMDDR1(NCD1TVA)=  1
ELSE
  IF(LSCREEN) THEN
    IF(L3DVAR) THEN
      KCMDDR1(NCD1TVA)=  3
    ELSE
      KCMDDR1(NCD1TVA)=  4
    ENDIF
  ENDIF
ENDIF

!*          1.53  IFS CONF. NO. ! to be looked at (set miss for now)

KCMDDR1(NCD1CON)=  NMDI

!*          1.54  IFS NO. OF TIME STEPS ! to be looked at (set miss for now)

KCMDDR1(NCD1NST)=  NMDI

!*          1.55  BASIC LEN. OF REP. HEADER ! to be looked at (set miss for
!                 now)

!KCMDDR1(NCD1NC )=  NCMFHL
KCMDDR1(NCD1NC )=  NMDI

!*          1.56  BASIC LEN. OF REP. BODY ENTRY ! to be looked at (set miss)

!KCMDDR1(NCD1BLB)=  NCMFBL + NCMRBLN
KCMDDR1(NCD1BLB)=  NMDI

!*          1.57  NO. OF 1D VAR (TOVS) RETREIVED LEVELS ! not good (=0)

!KCMDDR1(NCD11DL)=  NO1DVLV
KCMDDR1(NCD11DL)=  43

!*          1.58  NO. OF 1D VAR (TOVS) UPPERAIR RETREIVED VARIABLES
!                 not good (=0)

!KCMDDR1(NCD11DV)=  NO1DVVA
KCMDDR1(NCD11DV)=  7

!*          1.59  NO. OF 1D VAR (TOVS) SINGLE LEVEL RETREIVED VARIABLES ! not
!                 good (=0)

!KCMDDR1(NCD11DS)=  NO1DVSLV
KCMDDR1(NCD11DS)=  16

!*          1.60  MODEL PROFILES ! TO BE LOOKED at

KCMDDR1(NCD1MPF)=  0
IF(LMODPRF)              THEN
  KCMDDR1(NCD1MPF)    = IBSET(KCMDDR1(NCD1MPF), 0)
  IF(LMPSYNOP)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 1)
  ENDIF
  IF(LMPAIREP)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 2)
  ENDIF
  IF(LMPSATOB)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 3)
  ENDIF
  IF(LMPDRIBU)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 4)
  ENDIF
  IF(LMPTEMP )             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 5)
  ENDIF
  IF(LMPPILOT)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 6)
  ENDIF
  IF(LMPSATEM)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 7)
  ENDIF
  IF(LMPPAOB )             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 8)
  ENDIF
  IF(LMPSCAT )             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF), 9)
  ENDIF
  IF(LMPLIMB)             THEN
    KCMDDR1(NCD1MPF) = IBSET(KCMDDR1(NCD1MPF),10)
  ENDIF
ENDIF

!*          1.61  NO. OF MODEL SURFACE VARIABLES ! to be looked at (preset)

!KCMDDR1(NCD1MSV)=  NOMODSV
KCMDDR1(NCD1MSV)=  15

!*          1.62  NO. OF MODEL LEVELS ! to be looked at (preset)

!KCMDDR1(NCD1MLV)=  NOMODLV
KCMDDR1(NCD1MLV)=  31

!*          1.63  NO. OF MODEL UPPERAIR VARIABLES ! to be looked at (preset)

!KCMDDR1(NCD1MUV)=  NOMODUV
KCMDDR1(NCD1MUV)=   4

!*          1.64  64 NO. OF BUFR INPUT 6HR TIME SLOTS ! to be looked at

!KCMDDR1(NCD1NBS)=  NOBF      !  to be dealt with later

!*          1.65  65-74 BUFR TIME SLOT DATES AND TIMES

!KCMDDR1(NCD11BSD)=  NBFDATE( 1)
!KCMDDR1(NCD11BST)=  NBFTIME( 1)
!KCMDDR1(NCD12BSD)=  NBFDATE( 2)
!KCMDDR1(NCD12BST)=  NBFTIME( 2)
!KCMDDR1(NCD13BSD)=  NBFDATE( 3)   !  to be dealt with later
!KCMDDR1(NCD13BST)=  NBFTIME( 3)
!KCMDDR1(NCD14BSD)=  NBFDATE( 4)
!KCMDDR1(NCD14BST)=  NBFTIME( 4)
!KCMDDR1(NCD15BSD)=  NBFDATE( 5)
!KCMDDR1(NCD15BST)=  NBFTIME( 5)

!*          1.75  NO. OF 1D VAR (SSMI/TRMM) RETREIVED LEVELS ! to be looked
!                 (preset)

!KCMDDR1(NCD11DLS)=  NO1DVLVS
KCMDDR1(NCD11DLS)=  40

!*          1.76  NO. OF 1D VAR (SSMI/TRMM) UPPERAIR RETREIVED ! to be looked 
!                 (preset)
!                 VARIABLES

!KCMDDR1(NCD11DVS)=  NO1DVVAS
KCMDDR1(NCD11DVS)=   7

!*          1.77  NO. OF 1D VAR (SSMI/TRMM) SINGLE LEVEL RETREIVED
!                 VARIABLES

!KCMDDR1(NCD11DSS)=  NO1DSLVS
KCMDDR1(NCD11DSS)=  15

!*          1.78  NO. OF 1D VAR (LEVEL-1C/GEOS) RETREIVED LEVELS

!KCMDDR1(NCD11DLA)=  NO1DVLVA
KCMDDR1(NCD11DLA)=  43

!*          1.79  NO. OF 1D VAR (LEVEL-1C/GEOS) UPPERAIR RETREIVED
!                 VARIABLES

!KCMDDR1(NCD11DVA)=  NO1DVVAA
KCMDDR1(NCD11DVA)=   7

!*          1.80  NO. OF 1D VAR (LEVEL-1C/GEOS) SINGLE LEVEL RETREIVED
!                 VARIABLES

!KCMDDR1(NCD11DSA)=  NO1DVSLVA
KCMDDR1(NCD11DSA)=  16

!*          1.81  TOVS/LEVEL-1C/GEOS/SSMI/TRMM CMA OPTIONAL HEADER PART
!                 CONTENT : to be looked at

!KCMDDR1(NCD1SOH)=  0
KCMDDR1(NCD1SOH)= 36731967
!IF(LTOVSOH)                   THEN
!  KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 0)
!  IF(LTOPASS)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 1)
!  ENDIF
!  IF(LTO1DVA)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 2)
!  ENDIF
!  IF(LTO1DSL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 3)
!  ENDIF
!  IF(LTO1DUL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 4)
!  ENDIF
!  IF(LTOBICO)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH), 5)
!  ENDIF
!ENDIF
!IF(LSSMIOH)              THEN
!  KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),10)
!  IF(LSSPASS)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),11)
!  ENDIF
!  IF(LSS1DVA)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),12)
!  ENDIF
!  IF(LSS1DSL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),13)
!  ENDIF
!  IF(LSS1DUL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),14)
!  ENDIF
!ENDIF
!IF(LATOVOH)              THEN
!  KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),20)
!  IF(LATPASS)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),21)
!  ENDIF
!  IF(LAT1DVA)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),22)
!  ENDIF
!  IF(LAT1DSL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),23)
!  ENDIF
!  IF(LAT1DUL)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),24)
!  ENDIF
!  IF(LATBICO)                   THEN
!    KCMDDR1(NCD1SOH) = IBSET(KCMDDR1(NCD1SOH),25)
!  ENDIF
!ENDIF

!*          1.82  82-100 SET TO MISSING

DO JRES = 82, 100
  KCMDDR1(JRES   )=  NMDI
ENDDO
!DO JRES = 82, KCMDDR1(NCD1IL )
! KCMDDR1(JRES   )=  NMDI
!ENDDO

!*          1.101 TIME SLOTTING ! to be dealt with JUST SET TO 7

!IF(.NOT.LSCREEN) THEN
!  KCMDDR1(101    )=  7
!  KCMDDR1(103    )=  20010101
!  KCMDDR1(104    )=  90000
!ENDIF
!KCMDDR1(108      )=  1
!KCMDDR1(109      )=  20010101
!KCMDDR1(110      )=  93000
!KCMDDR1(128      )=  2
!KCMDDR1(129      )=  20010101
!KCMDDR1(130      )=  103000
!KCMDDR1(148      )=  3
!KCMDDR1(149      )=  20010101
!KCMDDR1(150      )=  113000
!KCMDDR1(168      )=  4
!KCMDDR1(169      )=  20010101
!KCMDDR1(170      )=  123000
!KCMDDR1(188      )=  5
!KCMDDR1(189      )=  20010101
!KCMDDR1(190      )=  133000
!KCMDDR1(208      )=  6
!KCMDDR1(209      )=  20010101
!KCMDDR1(210      )=  143000
!KCMDDR1(228      )=  7
!KCMDDR1(229      )=  20010101
!KCMDDR1(230      )=  150000

!-----------------------------------------------------------------------

!        2.       FIRST ODB DDR FORMAT (REAL SECTION)
!                 ------------------------------------

!*          2.1   1-1024 NOT DEFINED

!KCMDDR1(NCD1LFS)=  1024
!IST = KCMDDR1(NCD1IL ) + 1
!IEND= KCMDDR1(NCD1IL ) + KCMDDR1(NCD1LFS)
!DO JRES = IST , IEND
!  PCMDDR1(JRES   )=  RMDI
!ENDDO
!*
!-----------------------------------------------------------------------

!        3.       FIRST ODB DDR FORMAT (CHARACTER SECTION)
!                 -----------------------------------------

!IOFF = KCMDDR1(NCD1IL ) + KCMDDR1(NCD1LFS)

!*          3.1   PRE-PROCESSOR VERSION NO.

!WRITE(CLPROCV(1:4),'(A4)') NPPROCV1
!WRITE(CLPROCV(5:8),'(A4)') NPPROCV2
!CALL CHAR2INT(CLPROCV,IPPROCV,1,8,8)

!*          3.1.1 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV1)=  IPPROCV( 1)

!*          3.1.2 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV2)=  IPPROCV( 2)

!*          3.1.3 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV3)=  IPPROCV( 3)

!*          3.1.4 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV4)=  IPPROCV( 4)

!*          3.1.5 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV5)=  IPPROCV( 5)

!*          3.1.6 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV6)=  IPPROCV( 6)

!*          3.1.7 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV7)=  IPPROCV( 7)

!*          3.1.8 PRE-PROCESSOR VERSION NO.

!KCMDDR1(IOFF+NCD1PV8)=  IPPROCV( 8)

!*          3.2   EXPERIMENT NAME

!*          3.2.1 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN1 )

!*          3.2.2 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN2 )

!*          3.2.3 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN3 )

!*          3.2.4 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN4 )

!*          3.2.5 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN5 )

!*          3.2.6 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN6 )

!*          3.2.7 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN7 )

!*          3.2.8 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN8 )

!*          3.2.9 EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN9 )

!*          3.2.10EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN10)

!*          3.2.11EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN11)

!*          3.2.12EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN12)

!*          3.2.13EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN13)

!*          3.2.14EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN14)

!*          3.2.15EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN15)

!*          3.2.16EXPERIMENT NAME

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1EN16)

!*          3.3   VARIATIONAL JOB TYPE

!read(CL_1H,'(a1)') KCMDDR1(IOFF+NCD1VAT)

!*          3.4   27-1024 NOT DEFINED

!IST = IOFF + 26
!IEND= KCMDDR1(NCD1IL ) + KCMDDR1(NCD1LFS) + KCMDDR1(NCD1LSS)
!DO JRES = IST , IEND
!  read(CL_1H,'(a1)') KCMDDR1(JRES   )
!ENDDO

!*
!-----------------------------------------------------------------------

!        4.       RETURN
!                 ------
 
WRITE (NULOUT,'('' ddr 1 out '')')
DO JPR = 1 , 1024
  WRITE (NULOUT,'('' '',i4,1x,i10)') JPR,KCMDDR1(JPR)
ENDDO

IF (LHOOK) CALL DR_HOOK('IFSODBDDR1F',1,ZHOOK_HANDLE)
END SUBROUTINE IFSODBDDR1F
