SUBROUTINE WRIMOVA(KVERS,CD_CLMOD,KUSED,KINDAT,KSSSSS,KSTTYP,PSTRET,PLOCEN,&
 & PMUCEN,KDLON,KDGLG,KSMAX,KFLEVG,PLATIG,KLOENG,KDGSAG,KDGENG,KPPPSH)  

!**** *WRIMOVA* -

!     Purpose.
!     --------
!        WRITE Header of movies file in 32 bits

!**   Interface.
!     ----------
!        *CALL* *WRIMOVA*

!     Method.
!     -------

!     Author.
!     -------

!     Modifications.
!     --------------
!        Original : 98-03-13
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     R. El Khatib 05-03-11 Cleanups
!     ------------------------------------------------------------------

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KDGSAG 
INTEGER(KIND=JPIM),INTENT(IN)    :: KDGENG 
INTEGER(KIND=JPIM),INTENT(IN)    :: KVERS 
CHARACTER(LEN=*)  ,INTENT(IN)    :: CD_CLMOD
INTEGER(KIND=JPIM),INTENT(IN)    :: KUSED 
INTEGER(KIND=JPIM),INTENT(IN)    :: KINDAT 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSSSSS 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSTTYP 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PSTRET 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PLOCEN 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PMUCEN 
INTEGER(KIND=JPIM),INTENT(IN)    :: KDLON 
INTEGER(KIND=JPIM),INTENT(IN)    :: KDGLG 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSMAX 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFLEVG 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PLATIG(KDGSAG:KDGENG) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KLOENG(KDGSAG:KDGENG) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KPPPSH 

! The next declaration in simple precision is justified 
! to write out the file in simple precision
REAL(KIND=JPRM) :: ZSTRET,ZLOCEN,ZMUCEN,ZLATIG(KDGSAG:KDGENG)

INTEGER(KIND=JPIM) :: JLAT
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

! Convert to simple precision
ZSTRET=PSTRET
ZLOCEN=PLOCEN
ZMUCEN=PMUCEN
ZLATIG(1:KDGLG)=PLATIG(1:KDGLG)

! Write out
WRITE (KPPPSH) KVERS, CD_CLMOD, KUSED
WRITE (KPPPSH) KINDAT,KSSSSS,KSTTYP,ZSTRET,ZLOCEN,ZMUCEN,KDLON,KDGLG,KSMAX,&
 & KFLEVG  
!     * Latitudes of gaussian grid
WRITE (KPPPSH) (ZLATIG(JLAT),JLAT=1,KDGLG)
!     * Number of points par latitude
WRITE (KPPPSH) (KLOENG(JLAT),JLAT=1,KDGLG)

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

