SUBROUTINE WRMLPP(CDCONF)

!**** *WRMLPP*  - writes out the model level fields of the model

!     Purpose.
!     --------
!     Write out the model level fields of the model

!**   Interface.
!     ----------
!        *CALL* *WRMLPP(CDCONF)

!        Explicit arguments :     CDCONF - configuration of call
!        --------------------

!        Implicit arguments :      None.
!        --------------------

!     Method.
!     -------
!        See documentation

!     Externals.
!     ----------

!     Reference.
!     ----------
!        ECMWF Research Department documentation of the IFS

!        Note de travail ARPEGE NR 17

!     Author.
!     -------
!        Mats Hamrud and Philippe Courtier  *ECMWF*

!     Modifications.
!     --------------
!       Original : 88-03-02
!       MODIFICATION FOR *FA* FILE : 07-90  (Yves Bouteloup *EERM/CRMD*)
!       MODIFIED BY F.RABIER AND J.N THEPAUT : 91-01-15 (obs management)
!       Modified 91-02-28 by Michel Deque (Relaxation of deep soil values)
!       Modified 91-05-21 by A.Lasserre-Bigorry (scalar variables)
!       Modified by J.N Thepaut : 91-08-22 (comparison model-analysis)
!       Modified by Y.Bouteloup : 92-04-15 (Poles in trajectory files
!       for all configurations)
!       Modified  92-04-20  R. E.K. and J.-F. G. (reduced grid, etc..)
!       Modified  92-04-29  J.-J. Morcrette      (ECMWF physics)
!       Modified  30/5/92 A. Joly : write out 'modern pp' fields
!       Modified  92-05-05  W. Maurel and P. Le Moigne (vegetation scheme)
!       Modified  92-06-12  R. El Khatib ( History witness file)
!       Modified  92-10-01  M.Hamrud (IO-scheme, ECMWF output formats)
!       Modified  92-09-16  R. El Khatib (parameterization of file name)
!       Modified  93-10-29 M.Hamrud (split in two routines, one for
!       writing out in GRIB, one for ARPEGE file output)                   
!       R. El Khatib 02-03-19 lagged Fourier diffusion before writing out
!       M.Hamrud      01-Oct-2003 CY28 Cleaning
!       K.Yessad (Dec 2003): cleaning of horizontal diffusion.
!        M.Hamrud      01-DEC-2003 CY28R1 Cleaning
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMCT0   , ONLY : LGRBOP   ,LFPOS

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

IMPLICIT NONE

CHARACTER(LEN=1)  ,INTENT(IN)    :: CDCONF 

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

REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "wrmlppa.intfb.h"
#include "wrmlppg.intfb.h"

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

IF (LHOOK) CALL DR_HOOK('WRMLPP',0,ZHOOK_HANDLE)

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

!*       1.    CALL APPROPRIATE OUTPUT ROUTINE
!              -------------------------------

!*       1.1   GRIB OUTPUT

IF(LGRBOP.AND.(.NOT.LFPOS)) THEN
  CALL WRMLPPG(CDCONF)
ENDIF

!*       1.2   ARPEGE FILE OUTPUT

IF(.NOT.LGRBOP) THEN
  CALL WRMLPPA(CDCONF)
ENDIF

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

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