SUBROUTINE SUSIMPR

!**** *SUSIMPR*  - SET-UP FOR HORIZONTAL MEANS IF DDH IS NOT USED

!     Purpose.
!     --------
!       - ALLOCATION AND COMPUTATION OF THE WEIGHTS FOR EACH POINT
!         WARNING: PREPARED ONLY FOR ARPEGE !!!!
!         Computes HDSF = weight of each point. Currently HDSF is set to GAW
!         (Gaussian weights).

!**   Interface.
!     ----------
!        *CALL* *SUSIMPR

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

!        Implicit arguments :
!        --------------------

!     Method.
!     -------
!        See documentation about simplified physics

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

!     Reference.
!     ----------
!        Documentation about simplified physics

!     Author.
!     -------
!        Original : 99-02-15 by M. Janiskova,
!         adopted the computation of the weight of each point in the case
!         when DDH is not called.

!     Modifications.
!     --------------
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

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

USE YOMDIM   , ONLY :     NDGSAG   ,NDGENG   ,NDGENL
USE YOMCT0   , ONLY : NPRINTLEV,LALLOPR
USE YOMLUN   , ONLY : NULOUT
USE YOMGC    , ONLY : GAW
USE YOMGEM   , ONLY : NSTAGP   ,NGPTOT
USE YOMLEG   , ONLY : RW
USE YOMMP    , ONLY : MY_REGION_NS   ,MY_REGION_EW   ,NONL     ,NPTRFRSTLAT,&
 & NFRSTLAT ,NLSTLAT  
USE YOMMDDH  , ONLY : HDSF

IMPLICIT NONE

INTEGER(KIND=JPIM) :: ILOEN(NDGSAG:NDGENG)

INTEGER(KIND=JPIM) :: IGL, IGL1, IGL2, IGLOFF, IGUX, IIGL,&
 & ILAT, ILON, ILONDEP, IU, JGL  

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

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

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

!     1. Allocation of hdsf

ALLOCATE(HDSF(NGPTOT))
IF(LLP)WRITE(IU,9) 'HDSF     ',SIZE(HDSF  ),SHAPE(HDSF  )

!     2. Initialization of the dimension

IGUX=NDGENL
ILONDEP=1
IIGL=0
IGLOFF = NPTRFRSTLAT(MY_REGION_NS)
IGL1 = NFRSTLAT(MY_REGION_NS)
IGL2 = NLSTLAT(MY_REGION_NS)
DO JGL=IGL1,IGL2
  IGL=IGLOFF+JGL-IGL1
  IIGL=IIGL+1
  ILOEN(IIGL)=NONL(IGL,MY_REGION_EW)
ENDDO

!     3. Weigths for each grid point

HDSF(:) = GAW(:)

ILAT = IGUX/2
ILON = ILOEN(ILAT)/2
IF (NPRINTLEV >= 1) THEN
  WRITE (NULOUT,*) ' '
  WRITE (NULOUT,*) ' JGL = ',ILAT,' JLON = ',ILON
  WRITE (NULOUT,*) ' RW = ',RW(ILAT),' ILOEN = ',ILOEN(ILAT)
  WRITE (NULOUT,*) ' HDSF(',ILON+NSTAGP(ILAT)-ILONDEP,')= ',&
   & HDSF(ILON+NSTAGP(ILAT)-ILONDEP)  
ENDIF

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

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