SUBROUTINE SUALCLIA

!     PURPOSE.
!     --------

!       This routine allocates space for arrays in PTRSPOR
!       (used in the computation of spectral orography)

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

!     CALL SUALCLIA

!     METHOD.
!     -------

!       The working space is shared and pointers are calculated.

!     EXTERNALS.
!     ----------

!     AUTHORS.
!     --------

!        M. DEQUE  1 FEB 91.
!     Modified by R. EL Khatib : 94-03-08 comdeck PTRSPOR
!     Modified : 95-12-22 M.Hamrud    Change of XREV,XPDS layout
!     Modified : 99-06-22 P.Marguinaud,Y.Moudden modified envelope 
!     Modified : 99-07-21 D. Giard  Add diagnostic array 
!     Modified : 99-09-21 V. Ivanovici  Add diagnostic array for ALADIN 
!     Modified : 01-03-08 S. Alexandru  Add XEXT for the extension zone
!     Modified : 03-01-13 D. Giard      Add XPDL for spectral smoothing
!     Modified : 05-04-04 D. Giard      Remove semi-envelope
!     ------------------------------------------------------------------

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

USE YOMCT0   , ONLY : NPRINTLEV,LALLOPR
USE YOMLUN   , ONLY : NULOUT
USE YOMDIM   , ONLY : NSEFRE   ,NDLON    ,NDGLG
USE YOMGEM   , ONLY : NGPTOT
USE PTRSPOR  , ONLY : XRNM     ,XSNM     ,XREV     ,XPDS     ,&
 & XEXT     ,XPDL       

IMPLICIT NONE

LOGICAL :: LLP
REAL(KIND=JPRB) :: ZHOOK_HANDLE

!     ------------------------------------------------------------------
!*
!     1. PROCESSING.
!        -----------

IF (LHOOK) CALL DR_HOOK('SUALCLIA',0,ZHOOK_HANDLE)
LLP = NPRINTLEV >= 1 .OR. LALLOPR

ALLOCATE ( XRNM(NSEFRE) )
ALLOCATE ( XSNM(NSEFRE) )
ALLOCATE ( XPDL(NSEFRE) )
ALLOCATE ( XREV(NGPTOT) )
ALLOCATE ( XPDS(NGPTOT) )
ALLOCATE ( XEXT(NDLON,NDGLG) )

IF (LLP) THEN
  WRITE(NULOUT,9) 'XRNM      ',SIZE(XRNM     ),SHAPE(XRNM     )
  WRITE(NULOUT,9) 'XSNM      ',SIZE(XSNM     ),SHAPE(XSNM     )
  WRITE(NULOUT,9) 'XPDL      ',SIZE(XPDL     ),SHAPE(XPDL     )
  WRITE(NULOUT,9) 'XREV      ',SIZE(XREV     ),SHAPE(XREV     )
  WRITE(NULOUT,9) 'XPDS      ',SIZE(XPDS     ),SHAPE(XPDS     )
  WRITE(NULOUT,9) 'XEXT      ',SIZE(XEXT     ),SHAPE(XEXT     )
ENDIF

9 FORMAT(1X,'ARRAY ',A10,' ALLOCATED ',8I8)

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