SUBROUTINE DEALNMI

!**** *DEALNMI* - Deallocate arrays used in normal mode calculations

!     Purpose.
!     -------
!           Deallocation of the arrays needed for normal mode initiali-
!           zation when they are no longer needed. Only done for 
!           NCONF/100.eq.0 (NCONF=1 or NCONF=2) where we use most memory.

!**   Interface.
!**   ---------
!**         DEALNMI is called from routine CNT3

!     Author.
!     -------
!        L.Isaksen  *ECMWF*

!     Modifications.
!     --------------
!        Original : 97-05-05
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        M.Hamrud      01-Dec-2003 CY28R1 Cleaning

USE PARKIND1  ,ONLY : JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMSPHB  , ONLY : SPHBUF   ,NSTASPHB
USE YOMHOUB  , ONLY : HOUBUF   ,NSTAHOUB
USE YOMNMIB  , ONLY : LTYPGR   ,FREQ
USE YOMPINB  , ONLY : RPINBUF  ,NSTAPINB

IMPLICIT NONE
REAL(KIND=JPRB) :: ZHOOK_HANDLE
!------------------------------------------------------

!*        1.    DEALLOCATE
!               ----------

IF (LHOOK) CALL DR_HOOK('DEALNMI',0,ZHOOK_HANDLE)
IF (ALLOCATED(SPHBUF)) DEALLOCATE(SPHBUF)
IF (ALLOCATED(HOUBUF)) DEALLOCATE(HOUBUF)
IF (ALLOCATED(NSTAPINB)) DEALLOCATE(NSTAPINB)
IF (ALLOCATED(RPINBUF)) DEALLOCATE(RPINBUF)
IF (ALLOCATED(NSTASPHB)) DEALLOCATE(NSTASPHB)
IF (ALLOCATED(NSTAHOUB)) DEALLOCATE(NSTAHOUB)
IF (ALLOCATED(FREQ)) DEALLOCATE(FREQ)
IF (ALLOCATED(LTYPGR)) DEALLOCATE(LTYPGR)

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