      SUBROUTINE HYBRID
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION THEC(21),THES(21),C3I(21)
      COMMON/GEOM1/XB(240),RB(240),RBP(240),C2,BET
      COMMON/GEO2/NFL,NN,IPRINT,MAL,MAX,IPR
      COMMON/RX/XR(20,6),G(20),GCH,DM,N,N1(20),IX,I1
      COMMON/ICOU/VOLN,SOBS,RJA1,RJA2,ICOUNT,NGOL,NHBS
      COMMON/DFO/FIO,FIOX,FIOR,FIOXX,FIOXR,FIORR
      COMMON/DF1/FI1,FI1X,FI1R,XIOX,XIOR
      COMMON/GEO3/VOVS,AL,YINT,F,RR,RREF,AREF,DLN
      COMMON/NNI/NTT(11),NP5,JZT
      COMMON/DATA1/C(240),C1(240),B(240),C3
      COMMON/DISC/R1,PI,I,JH,J,KL
      COMMON/WAVE/CABL,CNBL,CMBL,CAW,CNW,CMW
      COMMON/CVP/CXT(240),CNT(240),CMT(240),CPV(21),JA,JB,KF
      IF(JZT.EQ.1) GO TO 108
      ER=1.D0/(.2D0*VOVS**2)+1.D0-.0001D0
      AS1=2.D0/(1.4D0*VOVS**2)
      AS2=0.2D0*VOVS**2
      AS3=AS2+1.D0
      COSAL=DCOS(AL)
      SINAL=DSIN(AL)
      DF=PI/(KF-1.)
      BETA=BET
      VOV2=VOVS**2
      BET2=BETA**2
      NTS=NTT(NHBS)
      CF=-.060D0
      DO 47 IJ=1,KF
      TET=(IJ-1)*DF
      THEC(IJ)=DCOS(TET)
      THES(IJ)=DSIN(TET)
  47  END DO
      TA=RBP(1)
      TA2=TA**2
      T=BETA*TA
      T2=T**2
      F2=DSQRT(1.D0-T2)
      F1=DLOG((1.D0+F2)/T)
      SC=TA2/(F2+TA2*F1)
      FIO=SC*(F2-F1)
      FIOX=-SC*F1
      FIOR=SC*F2/TA
      FIOXX=-SC/F2
      FIOXR=SC/(F2*TA)
      FIORR=FIOXX/TA2
      PC=(1.D0+0.2D0*VOV2*TA2)*0.55D0/F2**2
      AN=1.2D0*VOV2/BET2
      ANT=AN*TA
      S=FIO+ANT*FIOR
      PSIX=VOV2*(S*FIOXX+FIOX*(FIOX+ANT*FIOXR)-
     *0.75D0*TA*FIOR**2*FIOXR*PC)
      PSIR=VOV2*(S*FIOXR+FIOX*((1.D0+AN)*
     *FIOR+ANT*FIORR)-0.25D0*FIOR**2*(FIO
     *R+3.D0*TA*FIORR)*PC)
      SC1=TA*(TA*(1.D0+PSIX)-PSIR)/(F2+TA2*F1)
      C(1)=SC
      C1(1)=SC1
      AB=SC1/SC
      PHIR=PSIR+AB*FIOR
      PHIX=PSIX+AB*FIOX
      SB=2.D0*BETA*TA2/((1.D0+2.D0*TA2)*F2+T**2*F1)
      B(1)=SB
      FI1=0.5D0*SB*(F2/T-T*F1)
      FI1X=SB*F2/T
      FI1R=-0.5D0*SB*BETA*(F2/T2+F1)
      SU1=COSAL*(1.D0+PHIX)
      SU2=SINAL*FI1X
      SV1=COSAL*PHIR
      SV2=SINAL*(1.D0+FI1R)
      SW1=-SINAL*(1.D0+FI1/TA)
      DO 53 IJ=1,KF
      COST=THEC(IJ)
      UB=SU1+SU2*COST
      VB=SV1+SV2*COST
      WB=SW1*THES(IJ)
      QB=UB**2+VB**2+WB**2
      CP=AS1*(DSQRT((AS3-AS2*QB)**7)-1.D0)
      CPV(IJ)=CP
  53  END DO
      I=1
      CALL POPIN
      IK=2
      DO 7 I=2,NN
      RBI=RB(I)
      RBPI=RBP(I)
      XBI=XB(I)
      X=XBI-XB(I-1)+BETA*RB(I-1)
      T=BETA*RBI/X
      IF(T.GT.0.999999D0) T=0.999999D0
      T2=T**2
      X0=XBI-XB(1)
      T0=BETA*RBI/X0
      T02=T0**2
      F20=DSQRT(1.D0-T02)
      F30=F20/T0
      F10=DLOG(1.D0/T0+F30)
      F50=X0*(F30-T0*F10)
      R1=1.D0
      F2=DSQRT(1.D0-T2)
      F3=F2/T
      F1=DLOG(1.D0/T+F3)
      F5=X*(F3-T*F1)
      F6=2.D0*X*(F1-F2)
      F7=-BETA*(F3/T+F1)
      DENC=BETA*F5+RBPI*F6
      DENB=0.5D0*F7-RBPI*F3
      FIO=SC*X0*(F20-F10)
      FIOX=-SC*F10
      FIOR=BETA*SC*F30
      FIOXX=-SC/(X0*F20)
      FIOXR=-FIOXX*BETA/T0
      FIORR=FIOXX*BET2/T02
      FI1=0.5D0*SB*F50
      FI1R=-0.5D0*SB*BETA*(F30/T0+F10)
      FI1X=SB*F30
      XIOX=-SC1*F10
      XIOR=BETA*SC1*F30
      IQ=NTT(2)+1
      IF(I.EQ.2) GO TO 36
      KL=1
      J2=I-1
      DO 8 J=2,J2
      CALL S4
 8    END DO
      DO 1 KR=2,N
      JH=NTT(KR)+1
      IQ=JH
      C3=C3I(KR)
      IF(I.LE.JH) GO TO 36
      CALL DISCO
      J=JH
      R1=-1.D0
      CALL S4
   1  END DO
   36 CT=(RBPI*(1.D0+FIOX)-FIOR)/DENC
      BT=(RBPI*FI1X-1.D0-FI1R)/DENB
      JL=NTT(IK)+1
      IF(I.LT.JL) GO TO 10
      RBPB=RBP(JL)
      RBPA=RBP(JL-1)
      S1=(RBPB-RBPA)/(BETA+RBPB)
      CT=S1*(1.D0+FIOX)
      BT=-S1*FI1X*BETA
   10 C(I)=CT
      B(I)=BT
      KL=2
      JH=IQ
      IF(I.LT.JH) GO TO 11
      CALL DISCO
      GO TO 12
   11 FIO=FIO+0.5D0*CT*X*(T*F5-F6)
      FIOX=FIOX-CT*F6
      FIOR=FIOR+BETA*CT*F5
      FIOXX=FIOXX-2.D0*CT*F1
      FIOXR=FIOXR+2.D0*BETA*CT*F3
      FIORR=FIORR+BETA*CT*F7
      FI1=FI1+0.5D0*BT*F5
      FI1X=FI1X+BT*F3
      FI1R=FI1R+0.5D0*BT*F7
   12 CONTINUE
      ANT=AN*RBI
      P=FIO+ANT*FIOR
      PS=VOV2*(P*FIOX-0.25D0*RBI*FIOR**3*PC)
      IF(JL.EQ.I) C3I(IK)=PS-PSI
      PSI=PS
      PSIXA=PSIX
      PSIRA=PSIR
      PSIX=VOV2*(P*FIOXX+FIOX*(FIOX+ANT*FIOXR)-
     *0.75D0*RBI*FIOR**2*FIOXR*PC
     *)
      PSIR=VOV2*(P*FIOXR+FIOX*((1.D0+AN)*
     *FIOR+ANT*FIORR)-0.25D0*FIOR**2*(FIO
     *R+3.D0*RBI*FIORR)*PC)
      C1T=(RBPI*(1.D0+XIOX+PSIX)-XIOR-PSIR)/DENC
      IF(I.LT.JL) GO TO 13
      C3=C3I(IK)
      IK=IK+1
      C1T=S1*(1.D0+XIOX)+((RBPB/BETA-3.D0)*C3/
     *(8.D0*RB(JL))+PSIRA-PSIR+RBPB*PS
     *IX-RBPA*PSIXA)/(BETA+RBPB)
   13 C1(I)=C1T
      IF(I.LT.JH) GO TO 14
      KL=3
      CALL DISCO
      GO TO 15
   14 XIOX=XIOX-C1T*F6
      XIOR=XIOR+BETA*C1T*F5
   15 CONTINUE
      IF(I.LE.NTS) GO TO 502
      PHIX=FIOX
      PHIR=FIOR
      GO TO 505
  502 PHIX=PSIX+XIOX
      PHIR=PSIR+XIOR
  505 SU1=COSAL*(1.D0+PHIX)
      SV1=COSAL*PHIR
      IF(RBPI.GE.0.D0) GO TO 2
      IF(FI1X.LE.CF) FI1X=CF
      IF(FI1R.GT.-1.D0) FI1R=-1.0001D0
    2 SU2=SINAL*FI1X
      SV2=SINAL*(1.D0+FI1R)
      SW1=-SINAL*(1.D0+FI1/RBI)
      DO 48 IJ=1,KF
      COST=THEC(IJ)
      UB=SU1+SU2*COST
      VB=SV1+SV2*COST
      WB=SW1*THES(IJ)
      QB=UB**2+VB**2+WB**2
      IF(QB.GT.ER)QB=ER
      CPV(IJ)=AS1*(DSQRT((AS3-AS2*QB)**7)-1.D0)
 48   END DO
      CALL POPIN
  7   END DO
 108  CALL NAVE
      RETURN
      END
