SUBROUTINE SC2RDGFP(KPROMA,KFIELDS,PBUF,KSTAGPB,KSTA,KEND,PGP)

!**** *SC2RDG* - Read in gridpoint array from work file

!     Purpose.  Read in gridpoint array from
!     --------  workfile or alternativly copy from grid-point buffer.

!     SC2RDGFP is identical to the old version of SC2RDG, which was used
!     before the introduction of the "gridpoint_buffer" type. It is retained
!     for use with AFPBUF because gridpoint_buffers_mix assume KPROMA=NPROMA.

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

!        Explicit arguments :  KPROMA  - dimensioning  
!        --------------------  KFIELDS - number of fields
!                              PBUF    - grid-point buffer
!                              KSTAGPB - start adress in buf.
!                              KSTA    - starting point in pct
!                              KEND    - end point in pct     
!                              PGP     - output array   

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

!     Method.
!     -------

!     Externals. MIOREAD - read routine from MIO package
!     ----------

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

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

!     Modifications.
!     --------------
!        Original : 92-08-01
!        R. El Khatib : 01-08-07 Pruning options
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFIELDS 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PBUF(:) 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSTAGPB 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSTA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KEND 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PGP(KPROMA,KFIELDS) 
! === END OF INTERFACE BLOCK ===

INTEGER(KIND=JPIM) :: ISTA, IWORDS, JF, IEND
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

!*       1.    READ IN GRIDPOINT ARRAY.
!              ------------------------

IF (LHOOK) CALL DR_HOOK('SC2RDGFP',0,ZHOOK_HANDLE)
IWORDS=KEND-KSTA+1

ISTA=KSTAGPB+1
IEND=KSTAGPB+IWORDS
DO JF=1,KFIELDS
  PGP(KSTA:KEND,JF)=PBUF(ISTA:IEND)
  ISTA=ISTA+IWORDS
  IEND=IEND+IWORDS
ENDDO

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

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