C
C PURPOSE: COMPUTE ELASTIC MULTIPOLAR COLLISIONAL RATE
C
C INPUTS:
C       IJ   LEVEL INDEX
C       K    MULTIPOLAR COMPONENT
C OUTPUTS:
C
C COMMON:
C
C RESTRICTIONS:  
C
C COMMENTS: OCTOBER 6, 1999, P. JUDGE
C 
	FUNCTION GAMMAE(IJ,K)
C
	INCLUDE 'PREC'
	INCLUDE 'PARAM'
	INCLUDE 'CSE'
	INCLUDE 'CLU'
	INCLUDE 'CATMOS'
	INCLUDE 'CATOM'
	INCLUDE 'CINPUT'
	INCLUDE 'CINTS'
	DATA ICALL /0/
	SAVE ICALL
C
	GAMMAE=0.0
	IF(ICOLL .EQ. 0) RETURN
	IF (ICALL.EQ.0) THEN 
	   WRITE (LJOBLO,'(A,1P,E9.2,0P,A)') 
     *  ' GAMMAE: FUDGE ELECTRONS SET TO ED *',CECOEF,
     *  ' FOR K=2 ONLY'
	   ICALL=ICALL+1
	ENDIF
	IF (K .EQ. 2) GAMMAE=CECOEF*ED
C
C EQ BEFORE (A4.10B) OF LANDI'S BOOK:
C
        AA=AJ(IJ) 
C	WRITE(*,*) AA
	FK=FLOAT(K)
        DO AN=-AA,AA
	   DO ANP=-AA,AA
	      DO P=-FK,FK
                N=INT(AN)
                NP=INT(ANP)
		F3=FUN3J(AA,AA,FK,-AN,ANP,P)
                GAMMAE=GAMMAE + CMM(IJ,IJ,N,NP)*F3*F3
     *            *(TWO*FK+ONE)/(TWO*AA+ONE)
C		WRITE(LOUT,*)'GAMMAE=',GAMMAE, AN,ANP,P,'CMM =', CMM(IJ,IJ,N,NP)
	     ENDDO
	  ENDDO
	ENDDO
	if(IDEBUG .NE. 0 .AND. GAMMAE .NE. 0.) WRITE(LOUT,*)
     * 'GAMMAE IJ, K ',GAMMAE, IJ, K
	RETURN
	END
