C======= MAIN PROGRAM FOR gamma0gg ========
C======= for s-subshell ===========
C=======   GOS(s-p)=-(1/3)q1 
C=======   GOS(s-d)=(2/15)q2
      INTEGER NE, RPAE,LL
      REAL*8 K,EPHEV,D1,D2,
     * GAMMAC,GAMMA,ETA,EPHRY(200),
     * RE1(200),IM1(200),RE2(200),IM2(200),
     * DEL1(200),DEL2(200),
     * EELRY1,EELRY,EPOROG          
C----------------------
      NAMELIST/GAM0/NE,LL,RPAE,EELRY1,
     *    EPHRY,RE1,RE2,DEL1,DEL2,IM1,IM2

      OPEN(5,FILE='SYS$INPU',STATUS='OLD')
      READ(5,GAM0)
      OPEN(6,FILE='SYS$OUTP',STATUS='NEW')
      EPOROG=EPHRY(1)-EELRY1 
C-------LL=0--------------------------------
      IF(LL.EQ.0)THEN
      WRITE(6,11)                        
  11  FORMAT('  EPHRy',7X,'RE1',7X,'IM1',7X,'DEL1',
     *   7X,'RE2',7X,'IM2',7X,'DEL2')                 
      DO 15 I=1,NE
      WRITE(6,20)EPHRy(I),RE1(I),IM1(I),DEL1(I),
     *           RE2(I),IM2(I),DEl2(I)
  20  FORMAT(7F10.4)
  15  CONTINUE   
      WRITE(6,30)                                                 
  30  FORMAT('      EphRy',7X,' EpheV',7X,'GAMMAC',7X,'GAMMA',7X,'ETA')
      DO 40 I=1,NE
        D1=DATAN(IM1(I)/RE1(I))
        D2=DATAN(IM2(I)/RE2(I))
        DEL1(I)=DEL1(I)+D1
        DEL2(I)=DEL2(I)+D2
      K=(-7.5)*EPHRY(I)/137.
	IF (RPAE.EQ.1) THEN
      GAMMAC=K/(RE1(I)**2+IM1(I)**2)*
     * ((RE2(I)*RE1(I)+IM2(I)*IM1(I))*
     *      COS(DEL2(I)-DEL1(I))-
     *  (IM2(I)*RE1(I)-RE2(I)*IM1(I))*
     *      SIN(DEL2(I)-DEL1(I))) 
       IF(I.EQ.1)THEN
       WRITE(6,1000)K,GAMMAC
 1000  FORMAT(' k,gam',2E15.8)
       END IF
	ELSE
       GAMMAC=K*RE2(I)/RE1(I)*COS(DEL2(I)-DEL1(I))
	END IF
       GAMMA=GAMMAC*137.04*2./5./EPHRY(I) 
       ETA=-GAMMA
       EPHEV=EPHRY(I)*13.6057
       EELRY=EPHRY(I)-EPOROG
      WRITE(6,50) EPHRy(I),EELRY,GAMMAC,GAMMA,ETA
  50  FORMAT(2F10.5,3E15.5)
  40  CONTINUE
      END IF
      STOP
      END           	