	SUBROUTINE WKB(OMEGA,XL)
	IMPLICIT NONE
	Integer nom
	real*16 xl,YL,w81,w82,w83,w84,w85,w8m1,w8m2,w8m3,w8m4,w8m5,w8p1,w8p2,
     1         w8p3,w8p4,w8pd1,w8pd2,w8pd3,w8pd4
	real*16 omega,OM,ss
	real*16 w8,w8m,w8mll1,w8ml12,w8pdw2,w8p2dw3
	real*16 M,xi,omi,delom
        real*16 S70,S90,S91,S111,S112,S132,S133,
     1   S153,S154,S174,S175,
     2   s194,S195,S196
        real*16 S10,S30,S50,S51,S71,S72,S92,S113,S134
        real*16 sm10,s11,s31,s52,s73,s93,s114,s135,s155,s176,s197
	real*16 s216,s217,s218,s237,s238,s239,s258,s259
        real*16 R,F
        Real*16 um10,u10,u30,u31,u50,u51,u52,u70,u71,u72,u91,u92,u93,
     1    u112,u113,u114,u133,u134,
     2    u154,u155,u175,u176,u196,u217,u238
        Real*16 w10,w30,w50,w51,w70,w71,w72,w90,w91,w92,w111,w112,w113,
     1        w132,w133,w134,w153,w154,
     2        w174,w175,w195,w196,
     3	      w216,w217,w237,w238,w258
        Real*16 x30,x31,x50,x51,x70,x71,x72,x91,x92,x93,
     1     x112,x113,x133,x134,
     2     x154,x155,x175,x196,x217
        Real*16 y50,y51,y52,y70,y71,y72,y91,y92,y93,
     1   y112,y113,y114,y133,y134,
     2   y154,y155,y175,y176,y196,y217,y238
       Real*16 A22,A33,A34,A35,A44,B22,B33,B34,B35,B44
	integer l
       Common/series/A22,A33,A34,A35,A44,B22,B33,B34,B35,B44
	common/wwk/w8,w8m,w8mll1,w8pdw2,w8p2dw3
	common/test/w81,w82,w83,w84,w85,w8m1,w8m2,w8m3,w8m4,w8m5,w8p1,w8p2,w8p3,w8p4,
     -              w8pd1,w8pd2,w8pd3,w8pd4
        COMMON/PAR/M,xi,omi,delom,nom
        COMMON/wkbl/R,F
	Common/wkbterms/um10,u10,u30,u31,u50,u51,u52,u70,u71,u72,u91,u92,u93,
     1    u112,u113,u114,u133,u134,
     2    u154,u155,u175,u176,u196,u217,u238,
     3    w10,w30,w50,w51,w70,w71,w72,w90,w91,w92,w111,w112,w113,
     1        w132,w133,w134,w153,w154,
     2        w174,w175,w195,w196,
     3        w216,w237,w258,
     3    x30,x31,x50,x51,x70,x71,x72,x91,x92,x93,
     1     x112,x113,x133,x134,
     2     x154,x155,x175,x196,x217,
     3    y50,y51,y52,y70,y71,y72,y91,y92,y93,
     1   y112,y113,y114,y133,y134,
     2   y154,y155,y175,y176,y196,y217,y238
	YL = (XL+.5q0)**2
c  Note this is a different definition of om than appears in pqewkb8.f.
c  omega is the same here as om is in pqewkb8.f.
c 
        OM = qsqrt(OMEGA**2+F*YL/R**2+F*M**2)
c	Print *,'omega = ',omega,' CapOmega = ',OM,' M = ',M
	sm10 = om
	s10 = 1.q0/om
	s11 = yl/om
	s30 = 1.q0/om**3
	s31 = YL/om**3
	s50 = 1.q0/om**5
	s51 = YL/om**5
	s52 = YL**2/om**5
	s70 = 1.q0/om**7
	s71 = YL/om**7
	s72 = YL**2/om**7
	s73 = yl**3/om**7
	s90 = 1.q0/om**9
	s91 = YL/om**9
	s92 = YL**2/om**9
	s93 = YL**3/om**9
	s111 = YL/om**11
	s112 = YL**2/om**11
	s113 = YL**3/om**11
	s114 = YL**4/om**11
	s132 = YL**2/om**13
	s133 = YL**3/om**13
	s134 = YL**4/om**13
	s135 = yl**5/om**13
	s153 = YL**3/om**15
	s154 = YL**4/om**15
	s155 = YL**5/om**15
	s174 = YL**4/om**17
	s175 = YL**5/om**17
	s176 = YL**6/om**17
	s195 = YL**5/om**19
	s196 = YL**6/om**19
	s197 = yl**7/om**19
	s216 = yl**6/om**21
	s217 = yl**7/om**21
	s237 = yl**7/om**23
	s238 = yl**8/om**23
	s258 = yl**8/om**25
	s259 = yl**9/om**25
c	l = xl
c        write(19,99) s,l,sm10,s10,s11,s30,s31,s50
c        write(19,99) s,l,s51,s52,s70,s71,s72,s73 
c        write(19,99) s,l,s90,s91,s92,s93,s110,s111
c        write(19,99) s,l,s112,s113,s114,s130,s131,s132
c        write(19,99) s,l,s133,s134,s135,s150,s151,s152
c        write(19,99) s,l,s153,s154,s155,s170,s171,s172
c        write(19,99) s,l,s173,s174,s175,s176,s190,s191
c        write(19,99) s,l,s192,s193,s194,s195,s196,s197
c  99    Format(1x,f6.3,1x,f4.0,1x,6(d14.7,1x))
        w8 = sm10*um10+s10*u10+s30*u30+s31*u31+s50*u50+s51*u51+s52*u52+
     -       s70*u70+s71*u71+s72*u72+s91*u91+s92*u92+s93*u93+
     -       s112*u112+s113*u113+s114*u114+
     -       s133*u133+s134*u134+
     -       s154*u154+s155*u155+
     -       s175*u175+s176*u176+s196*u196+s217*u217+s238*u238
        w8m = s10*w10+s30*w30+s50*w50+s51*w51+s70*w70+s71*w71+s72*w72+
     -      s90*w90+s91*w91+s92*w92+s111*w111+
     1      s112*w112+s113*w113+s132*w132+s133*w133+s134*w134+
     2      s153*w153+s154*w154+s174*w174+
     -      s175*w175+
     3      s195*w195+s196*w196+s216*w216+
     4      s237*w237+s258*w258
        w8ml12 = s11*w10+s31*w30+s51*w50+s52*w51+s71*w70+s72*w71+s73*w72+
     -      s91*w90+s92*w91+s93*w92+s112*w111+
     1      s113*w112+s114*w113+s133*w132+s134*w133+s135*w134+
     2      s154*w153+s155*w154+s175*w174+
     -      s176*w175+
     3      s196*w195+s197*w196+s217*w216+s238*w237+s259*w258
        w8pdw2 = s30*x30+s31*x31+s50*x50+s51*x51+s70*x70+s71*x71+s72*x72+
     -      s91*x91+s92*x92+s93*x93+s112*x112+s113*x113+
     1      s133*x133+s134*x134+
     -      s154*x154+s155*x155+
     2      s175*x175+s196*x196+s217*x217
        w8p2dw3 = s50*y50+s51*y51+s52*y52+s70*y70+s71*y71+s72*y72+
     -      s91*y91+s92*y92+s93*y93+
     -      s112*y112+s113*y113+s114*y114+
     -      s133*y133+s134*y134+
     -      s154*y154+s155*y155+
     -      s175*y175+s176*y176+s196*y196+s217*y217+s238*y238
	w81 = sm10*um10
	w82 = s10*u10+s31*u31+s52*u52
	w83 = s30*u30+s51*u51+s72*u72+s93*u93+s114*u114
	w84 = s50*u50+s71*u71+s92*u92+s113*u113+s134*u134+s155*u155+s176*u176
        w85 = s70*u70+s91*u91+s112*u112+s133*u133+s154*u154+s175*u175+s196*u196+s217*u217+s238*u238
	w8m1 = s10*w10
	w8m2 = s30*w30+s51*w51+s72*w72
	w8m3 = s50*w50+s71*w71+s92*w92+s113*w113+s134*w134
	w8m4 = s70*w70+s91*w91+s112*w112+s133*w133+s154*w154+s175*w175+s196*w196
        w8m5 = s90*w90+s111*w111+s132*w132+s153*w153+s174*w174+s195*w195+s216*w216+s237*w237+s258*w258
	w8mll1 = w8ml12-0.25q0*w8m
	w8p1 = s31*x31
	w8p2 = s30*x30+s51*x51+s72*x72+s93*x93
	w8p3 = s50*x50+s71*x71+s92*x92+s113*x113+s134*x134+s155*x155
	w8p4 = s70*x70+s91*x91+s112*x112+s133*x133+s154*x154+s175*x175+
     1         s196*x196+s217*x217
	w8pd1 = s52*y52
	w8pd2 = s51*y51+s72*y72+s93*y93+s114*y114
	w8pd3 = s50*y50+s71*y71+s92*y92+s113*y113+s134*y134+s155*y155+s176*y176
	w8pd4 = s70*y70+s91*y91+s112*y112+s133*y133+s154*y154+s175*y175
     -           +s196*y196+s217*y217+s238*y238
 	RETURN
	END
