      SUBROUTINE QGPINF(ITK,NST1,NST2,NST3,DST1,DST2,DST3,CRCK,IER)
C-----------------------------------------------------------------------
C
C-----------------------------------------------------------------------
#include "qcde.h"
      INTEGER ITK,NST1,NST2,NST3,DST1,DST2,DST3,CRCK,IER
      INTEGER IL(6)
      LOGICAL FPGP,FPGA
#include "qmacro.h"
      DATA FPGP/.TRUE./
      DATA FPGA/.TRUE./
      DATA IL/8,9,23,24,25,1000/

c      CALL PRTABL('DGAC',0)
c      CALL PRTABL('PGAC',0)

      IF(XPGAC(ITK))THEN
       IER = 0
C
C DEBUGGING
C
C      KPGAST(KI)=IW(IW(KJQDET(KI)+JQDEPG)+JPGAST)                       JB941122
C      QPGAEF(KI)=RW(IW(KJQDET(KI)+JQDEPG)+JPGAEF)                       JB941123
C      QPGAGC(KI)=RW(IW(KJQDET(KI)+JQDEPG)+JPGAGC)                       JB941124
C      QPGAZS(KI)=RW(IW(KJQDET(KI)+JQDEPG)+JPGAZS)                       JB941125
C      QPGAPL(KI)=RW(IW(KJQDET(KI)+JQDEPG)+JPGAPL)                       JB941126
C      QPGAPH(KI)=RW(IW(KJQDET(KI)+JQDEPG)+JPGAPH)                       JB941127
C      KPGAPN(KI)=IW(IW(KJQDET(KI)+JQDEPG)+JPGAPN)                       JB941128
C      KPGAFA(KI)=IW(IW(KJQDET(KI)+JQDEPG)+JPGAFA)                       JB941129
C      KPGAPE(KI)=IW(IW(KJQDET(KI)+JQDEPG)+JPGAPE)                       JB941130
C      PARAMETER(JPGAEC=1,JPGATC=2,JPGAPC=3,JPGAR1=4,JPGAR2=5,JPGAF4=6,  PGACJJ 2
C     +          JPGADM=7,JPGAST=8,JPGAQU=9,JPGAQ1=10,JPGAQ2=11,         PGACJJ 3
C     +          JPGAM1=12,JPGAM2=13,JPGAMA=14,JPGAER=15,JPGATR=16,      PGACJJ 4
C     +          JPGAPR=17,JPGAEF=18,JPGAGC=19,JPGAZS=20,JPGAPL=21,      PGACJJ 5
C     +          JPGAPH=22,JPGAPN=23,JPGAFA=24,JPGAPE=25,LPGACA=25)      PGACJJ 6

c      POINTER = IW(KJQDET(ITK)+JQDEPG)
c      WRITE(6,*)' POINTER = ',POINTER
c      WRITE(6,*)
c      J=1
c      DO I = 1,26
c        IF(I.EQ.IL(J))THEN
c         DATA = IW(POINTER+I)
c         J=J+1
c        ELSE
c         DATA = RW(POINTER+I)
c        ENDIF
c        WRITE(6,*)I,DATA
c      ENDDO
C
C EXTRACT THE NUMBER OF STOREYS INFO
C
       NTEMP = KPGAST(ITK)
c       WRITE(6,*) NTEMP
       NST3 = NTEMP/10000
c       WRITE(6,*) NST3
       NTEMP = NTEMP - (NST3*10000)
c       WRITE(6,*) NTEMP
       NST2 = NTEMP/100
c       WRITE(6,*) NST2
       NST1 = NTEMP - (NST2*100)
c       WRITE(6,*) NST1
C
C EXTRACT THE CRACK INFO
C
       NTEMP = KPGPQU(ITK)
       DST3 = NTEMP/1000
       NTEMP = NTEMP - (DST3*1000)
       DST2 = NTEMP/100
       NTEMP = NTEMP - (DST2*100)
       DST1 = NTEMP/10
       CRCK = NTEMP-(DST1*10)
       IF(FPGA)THEN
           WRITE(6,*)' NEW GAMPEK PHOTON FOUND !'
           WRITE(6,*)' INFO: ',KPGAST(ITK),KPGPQU(ITK)
           FPGA = .FALSE.
       ENDIF
      ELSEIF(XPGP(ITK))THEN
       IER = 0
       IF(FPGP)THEN
           WRITE(6,*)' OLD GAMPEK PHOTON FOUND !'
           FPGP = .FALSE.
       ENDIF
C
C EXTRACT THE NUMBER OF STOREYS INFO
C
       NTEMP = int(QPGPST(ITK))
       NST3 = NTEMP/10000
       NTEMP = NTEMP - (NST3*10000)
       NST2 = NTEMP/100
       NST1 = NTEMP - (NST2*100)
C
C EXTRACT THE CRACK INFO
C
       NTEMP = KPGPQU(ITK)
       DST3 = NTEMP/1000
       NTEMP = NTEMP - (DST3*1000)
       DST2 = NTEMP/100
       NTEMP = NTEMP - (DST2*100)
       DST1 = NTEMP/10
       CRCK = NTEMP-(DST1*10)
      ELSE
       IER = -1
      ENDIF
      RETURN
      END
      

