SUBROUTINE SUCMAF(KMDI)

!**** SUBROUTINE SUCMAF - CENTRAL MEMORY ARRAY/ODB FORMAT

!        D. VASILJEVIC     ECMWF    30/08/1994

!**   PURPOSE
!     -------

!        SET CMA FORMAT

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

!        CALL SUCMAF(KMDI)
!     WHERE:
!           KMDI     = MISSING IND.

!        SUCMAF IS CALLED BY

!**   METHOD
!     ------

!        CMA/ODB FORMAT IS SET.

!**   EXTERNALS
!     ---------

!       SUCMAD1  - FIRST DDR FORMAT
!       SUCMAD2  - SECOND DDR FORMAT
!       SUCMAHF  - FIXED HEADER PART FORMAT
!       SUCMAHO  - OPTIONAL HEADER PART FORMAT
!       SUCMABDF - FIXED BODY ENTRY PART FORMAT
!       SUCMABRD - OPTIONAL (RUN DEPENDENT) BODY ENTRY FORMAT
!       SUCMABTD - OPTIONAL (OBS./CODE TYPE DEPENDENT) BODY ENTRY FORMAT

!**   MODIFICATION
!     ------------

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

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KMDI 
REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "sucmad1.intfb.h"
#include "sucmad2.intfb.h"
#include "sucmahfp.intfb.h"
#include "sucmahop.intfb.h"
#include "sucmbdfp.intfb.h"
#include "sucmbdtp.intfb.h"

!        1.       CMA/ODB DDR FORMAT
!                 ------------------

!*          1.1   FIRST CMA/ODB DDR

IF (LHOOK) CALL DR_HOOK('SUCMAF',0,ZHOOK_HANDLE)
CALL SUCMAD1

!*          1.2   SECOND CMA/ODB DDR

CALL SUCMAD2

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

!        2.        CMA HEADER FORMAT
!                  -----------------

!*          2.1    FIXED PART

CALL SUCMAHFP

!*          2.2    OPTIONAL (OBS./CODE TYPE DEPENDENT)

CALL SUCMAHOP(KMDI)
!*
!-----------------------------------------------------------------------

!        3.        CMA BODY ENTRY FORMAT
!                  ---------------------

!*          3.1    FIXED PART

CALL SUCMBDFP

!*          3.2    OPTIONAL PART (RUN DEPENDENT)

!*          3.3    OPTIONAL PART (OBS./CODE TYPE DEPENDENT)

CALL SUCMBDTP
!*
!-----------------------------------------------------------------------

!        4.       RETURN
!                 ------

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