SUBROUTINE DFI

!**** *DFI*  - Controls integration for digital filter initialization
!                on highest level

!     Purpose.
!     --------
!     CONTROLS  DIGITAL FILTER INITIALIZATION ON HIGHEST LEVEL

!**   Interface.
!     ----------
!        *CALL* *DFI

!        Explicit arguments : None
!        --------------------

!        Implicit arguments : Common YEMDFI
!        --------------------

!     Method.
!     -------

!     Externals.
!     ----------
!        DFI1: next level DFI control routine

!     Reference.
!     ----------
!     ARPEGE/ALADIN DOCUMENTATION

!     Author.
!     -------
!       Gabor Radnoti GMAP/MICECO

!     Modifications.
!     --------------
!        Original : 92-12-24
!        D. Giard : 93-07-28 SUFW called by SUDFI now ; EINIBACK,EDIACORR,
!                            EINIFIE replaced by COPSP and DIFSP
!        D. Giard : 93-08-28 temporary allocation for recursive filter
!        D. Giard : 93-10-15 simplification of recursive filter
!        D. Giard : 94-10-18 adiabatic time-step
!        D. Giard : 96-01-18 no more filtering of boundary fields
!        D.Giard, J.Latour : 96-09-20 call to DFI1 changed (spectral arrays)
!        D. Giard : 98-01-29 horizontal diffusion for adiabatic integrations
!        D. Giard : 99-07-19 LINITER moved from YOMNMIA to YOMINI
!        M.Hamrud   01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

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

USE YOMDFI   , ONLY : NEDFI    ,NSTDFI   ,NSTDFIA  ,RTDFI    ,&
 & RTDFIA   ,LADIFH  
USE YOMINI   , ONLY : LINITER

IMPLICIT NONE

INTEGER(KIND=JPIM) :: IDFITYP, ISTDFI, ISTDFIA

LOGICAL :: LLDIFH

REAL(KIND=JPRB) :: ZSTEP, ZSTEPA
REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "dfi1.intfb.h"

!* Set up dummy argument values for DFI1
!  --------------------------------------

IF (LHOOK) CALL DR_HOOK('DFI',0,ZHOOK_HANDLE)
IF (NEDFI == 0 .AND. LHOOK) CALL DR_HOOK('DFI',1,ZHOOK_HANDLE)
IF (NEDFI == 0) RETURN
IDFITYP= NEDFI
ISTDFI = NSTDFI
ZSTEP  = RTDFI
ISTDFIA= NSTDFIA
ZSTEPA = RTDFIA
LLDIFH = LADIFH

!* Call DFI1
!  ----------

LINITER=.TRUE.
CALL DFI1(IDFITYP,ISTDFI,ZSTEP,ISTDFIA,ZSTEPA,LLDIFH)
LINITER=.FALSE.

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