      SUBROUTINE VCOUL (K,KP,A,RC,R,VL,NLS,NIF)
C *** SEE R H LANDAU, PROGRAM LPOTT, 1981
C     THIS SUB DETERMINES PARTIAL WAVE DECOMP OF COULMB POT OF SPHERF ER
C     RC AND CUT OFF(MATCHING RADIUS) R
C     ALL UNITS ARE MEV-1
C     A= 3*Q1*Q2/(2 RC)
      IMPLICIT REAL*8 (A-H,K,M,O-Z)
      REAL*8 XCOS(48),WT(48)
      DIMENSION VL(30), PL(30), FF(4)
C
      DATA NIT/0/
      B = -A/(3*RC*RC)
      IF (NIT.NE.0) GO TO 10
C     1ST CALL TO VCOUL. SETUP PTSW WTS
      NCOSS = 48
      NIT = 1
      CALL GAUSS (NCOSS,011,-1.d0,1.d0,XCOS,WT)
 10   RHL1 = KP*KP+K*K
      RHL2 = 2*KP*K
      DO 20 I=1,NLS
         VL(I) = 0.
 20   CONTINUE
      DO 70 NCOS=1,NCOSS
         X = XCOS(NCOS)
         Q = SQRT(ABS(RHL1-RHL2*X))
         IF (Q.GT.1.) GO TO 30
C     SPECIAL Q=0 FORM --I THINK THIS IS OK
         VOFQ = (0.5/3.141593**2)*(A*(RC**3)/3+B*(RC**5)/5+(RC*A/3)*(R*R
     1   -RC*RC))
         GO TO 50
 30      CONTINUE
         RHL = Q*RC
         S = SIN(RHL)
         C = COS(RHL)
         Q2 = Q*Q
         IF (NIF.EQ.4) GO TO 40
         Q3 = Q2*Q
         Q5 = Q2*Q3
         VOFQ = (0.5/3.141593**2)*(A*(S-RHL*C)/Q3+B*((3*Q2*RC*RC-6)*S-
     1   (Q3*RC**3-6*RHL)*C)/Q5+2*RC*A*(C-COS(Q*R))/(3*Q2))
         GO TO 50
C     REALISTIC FORM FACTOR
 40      CONTINUE
         NNF = 1
         CALL FFACT (Q2,FF,NNF)
         VOFQ = (0.5/3.141593**2)*(A*2./3./Q/Q)*RC*(FF(1)-COS(Q*R))
 50      CONTINUE
         PL(1) = WT(NCOS)
         PL(2) = X*WT(NCOS)
         VL(1) = VL(1)+PL(1)*VOFQ
         VL(2) = VL(2)+PL(2)*VOFQ
         II = NLS-1
         IF (II.LT.2) GO TO 70
         DO 60 I=2,II
            G = X*PL(I)
            PL(I+1) = G-PL(I-1)+G-(G-PL(I-1))/I
            VL(I+1) = VL(I+1)+PL(I+1)*VOFQ
 60      CONTINUE
 70   CONTINUE
      DO 80 I=1,NLS
         VL(I) = VL(I)*(3.141593**2)
 80   CONTINUE
      RETURN
      END
