C
C PURPOSE: COMPUTE SUPERELASTIC MULTIPOLAR COLLISIONAL RATE
C
C INPUTS:
C       IJ    LOWER LEVEL INDEX
C       IJ1   UPPER LEVEL INDEX
C       K     MULTIPOLAR INDEX
C OUTPUTS:
C       GAMMAS
C COMMON:
C       CATOM CLU
C RESTRICTIONS:  THE TOTAL COLLISIONAL RATES C(I,J) ARE ASSUMED
C       TO BE THE RESULT OF 1 MULTIPOLE COMPONENT.  THIS MAY NOT BE 
C       CONSISTENT WITH THE INPUT DATA. SEE THE README FILE WITH THIS PROGRAM. 
C
C COMMENTS: OCTOBER 6, 1999, P. JUDGE
C 
	FUNCTION GAMMAS(IJ,IJ1,K)
	INCLUDE 'PREC'
	INCLUDE 'PARAM'
	INCLUDE 'CSE'
	INCLUDE 'CLU'
	INCLUDE 'CATMOS'
	INCLUDE 'CATOM'
	INCLUDE 'CINPUT'
	INCLUDE 'CINTS'
	GAMMAS=ZERO
	IF(ICOLL .EQ. 0 .OR. IJ1.LE.IJ) RETURN
C
	IF(ITTYPE(IJ1,IJ) .EQ. 1 .AND. K .EQ. 1) GAMMAS=C(IJ1,IJ)
	IF(ITTYPE(IJ1,IJ) .EQ. 2 .AND. K .EQ. 2) GAMMAS=C(IJ1,IJ)
C
C  CMM FORMALISM
C
C THIS IS THE EQUATION  AFTER EQ (A4.3) OF LANDI'S BOOK, FOR THE DIAGONAL CASE
C (N=N', N''=N''')
C
	AA=AJ(IJ) 
	AA1=AJ(IJ1)
	FK=FLOAT(K)
C
C HERE WE ASSUME FOR SPIN-CHANGING AND STRONG COUPLING CASES
C THAT C(IJ1,IJ,N1,N) = C(IJ1,IJ)/(2*IJ1+1)
	CASSUME=ZERO
	IF(ITTYPE(IJ1,IJ) .LE. 0 .AND. ICOLL .NE. 2) 
     *    CASSUME=C(IJ1,IJ)/(TWO*AA1+ONE)
C
	DO AN=-AA,AA
	   DO AN1=-AA1,AA1
	      DO P=-FK,FK
		 N=INT(AN)
		 N1=INT(AN1)
		 F3=FUN3J(AA,AA1,FK,-AN,AN1,P)
		 GAMMAS=GAMMAS + (CMM(IJ1,IJ,N1,N)+CASSUME)*F3*F3*
     *                    (TWO*FK+ONE)/(TWO*AA1+ONE)
C		 WRITE(*,*) CMM(IJ1,IJ,N1,N)
	      ENDDO
	   ENDDO
	ENDDO
	if(IDEBUG .NE. 0 .AND. GAMMAS .NE. 0.) WRITE(LOUT,*)
     *     'GAMMAS IJ,IJ1, K ',GAMMAS, IJ, IJ1, K
C          WRITE(*,*) 'GAMMAS IJ,IJ1, K ',GAMMAS, IJ, IJ1, K
	RETURN
	END



