SUBROUTINE SUSPGPG(PFPDAT,KPARAM)

!**** *SUSPGPG*  - Initialize some upper air gridpoint fields from
!                  spectral GRIB.

!     Purpose.
!     --------
!           Initialize the some upper air gridpoint fields of the model
!           from spectral GRIB file(s)

!**   Interface.
!     ----------
!        *CALL* *SUSPGPG(.....)*

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

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

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

!     Externals.  SPEREE - spectral to grid-point transform
!     ----------

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

!     Author.
!     -------
!        Mats Hamrud *ECMWF*

!     Modifications.
!     --------------
!        Original : 94-06-13
!        Modified : 95-06-06 L. Isaksen - Reordering of spectral arrays
!        Modified : 95-12-22 M.Hamrud    Change of ZREEL layout
!        Modified 98-08-10 by K. YESSAD: removal of LRPOLE option.
!          - removal of LRPOLE in YOMCT0.
!          - removal of LLPOLE and code under LRPOLE, LLPOLE.
!          - removal of argument LLPOLE in 'CALL SPEREE'.
!        Modified : 98-11-06 E.Holm      Ozone included
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

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

USE YOMDIM   , ONLY : NPROMA   ,NSPEC2    ,NFLEVL  
USE YOMCT3   , ONLY : LGPQINSP
USE YOMGRB   , ONLY : NGRBQ    
USE YOMGFL   , ONLY : GFL
USE YOMMP    , ONLY : NBSETLEV
USE YOM_YGFL , ONLY : YGFL     ,YGFLC
IMPLICIT NONE

! * DUMMY:
REAL(KIND=JPRB)   ,INTENT(IN)    :: PFPDAT(NFLEVL,NSPEC2)
INTEGER(KIND=JPIM),INTENT(IN)    :: KPARAM 
INTEGER(KIND=JPIM) ::  IPT,JGFL
REAL(KIND=JPRB) :: ZHOOK_HANDLE

INTERFACE
#include "inv_trans.h"
END INTERFACE

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

!*       1.  CONVERT TO GRIDPOINT SPACE.
!            ---------------------------
IF (LHOOK) CALL DR_HOOK('SUSPGPG',0,ZHOOK_HANDLE)
DO JGFL=1,YGFL%NUMFLDS
  IF(KPARAM == YGFLC(JGFL)%IGRBCODE) THEN
    IPT=YGFLC(JGFL)%MP
    EXIT
  ENDIF
ENDDO
CALL INV_TRANS(PSPSCALAR=PFPDAT,KPROMA=NPROMA,KVSETSC=NBSETLEV,&
 & PGP=GFL(:,:,IPT,:))  

IF(KPARAM == NGRBQ) THEN
  LGPQINSP = .TRUE.
ENDIF

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

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

