C====SINGLE INTEGRATION WITH A POLE===============                      
      SUBROUTINE ONE(OM,LAMM,RP,M,M1,RE,IM,C,Q,D1,RM)                   
C=========================================
      REAL*8 OM ,RE,IM,KAP,X1,X2,X3,X4,X5,                              
     *  U,V,A,B,T,XM0,XLAM,DELX,MIN,K3,                              
     *  LAMM(*),RP(*),                                                  
     *  C(*),Q(*),D1(*),RM(*)                                           
      INTEGER M,M1,JJ,W,IMIN,I                                          

      IF ( M.GT.M1 ) THEN                                               
      DELX=DSQRT(LAMM(M))-DSQRT(LAMM(M-1))                              
      K3=DELX/3                                                         
      XM0=DSQRT(LAMM(M1+1))                                             
      END IF                                                            
      DO 10 I=1, M                                                      
       Q(I)=0                                                           
       C(I)=0
       D1(I)=0                                                          
  10  CONTINUE                                                          
       XLAM=0                                                           
      IF ( OM.GT.0 ) XLAM=DSQRT(OM)                                     
      IF ( XLAM.EQ.0 ) GOTO 100                                         
C  ==== search for interval with a pole========
      DO 20 I=M1+1, M, 2                                                
        X1=DSQRT(LAMM(I))                                               
       X2=X1+DELX                                                       
       X3=X2+DELX                                                       
       W=I                                                              
      IF( W.EQ.M ) GOTO 100                                             
      IF ( XLAM.GE.(X1-DELX/2).AND.XLAM.LE.(X3-DELX/2)) GOTO 40         
  20  CONTINUE                                                          
  40  IF ( W.EQ.M1+1 ) THEN                                             
        X2=X1+DELX                                                      
       X3=X2+DELX                                                       
       A=(XLAM-X1)*(XLAM-X2)*(XLAM-X3)                                  
       U=DLOG(DABS((X3-XLAM)/(XLAM-X1)))                                
       V=(1/(X1-XLAM)+4/(X2-XLAM)+1/(X3-XLAM))*K3                       
       B=U-V                                                            
       T=B*A/DELX**2                                                    
       Q(W)=T/2                                                         
       Q(W+1)=-T                                                        
       Q(W+2)=T/2                                                       
      ELSE IF  (DABS((XLAM-X1)/DELX).LT.0.5 ) THEN                      
        X4=X1-DELX                                                      
       X5=X4-DELX                                                       
       A=(XLAM-X1)*(XLAM-X2)*(XLAM-X3)*(XLAM-X4)*(XLAM-X5)              
       U=DLOG(DABS((X3-XLAM)/(XLAM-X5)))                                
      V=(1/(X5-XLAM)+4/(X4-XLAM)+2/(X1-XLAM)+4/(X2-XLAM)+               
     * 1/(X3-XLAM))*K3                                                  
       B=U-V                                                            
       T=B*A/DELX**4                                                    
       Q(W-2)=T/24                                                      
       Q(W-1)=-T/6                                                      
       Q(W)=T/4                                                         
       Q(W+1)=-T/6                                                      
       Q(W+2)=T/24                                                      
      ELSE                                                              
        A=(XLAM-X1)*(XLAM-X2)*(XLAM-X3)                                 
       U=DLOG(DABS((X3-XLAM)/(XLAM-X1)))                                
       V=(1/(X1-XLAM)+4/(X2-XLAM)+1/(X3-XLAM))*K3                       
       B=U-V                                                            
       T=B*A/DELX**2                                                    
       Q(W)=T/2                                                         
       Q(W+1)=-T                                                        
       Q(W+2)=T/2                                                       
       END IF                                                           
C================================================
  100  C(M1+1)=K3                                                       
      DO 110 I=M1+2, M-1, 2                                             
       C(I)=4*K3                                                        
       C(I+1)=2*K3                                                      
  110  CONTINUE                                                         
       C(M)=K3                                                          
      DO 120 I=1, M1                                                    
  120  C(I)=1                                                           
C============================================
       KAP=XM0                                                          
       RE=0                                                             
      DO 130 W=1, M                                                     
      IF ( W.LE.M1 )D1(W)=1/(OM-LAMM(W))                                
       D1(W)=2*KAP/(OM-KAP**2)                                          
      IF ( W.GT.M1 )KAP=KAP+DELX                                        
 130  CONTINUE                                                          
      DO 101 IW=1,M
C      PRINT102, C(IW),Q(IW),D1(IW),RP(IW)
C 102  FORMAT(4E15.8)
 101  CONTINUE          
      DO 140 JJ=1, M                                                    
        RM(JJ)=RP(JJ)*(C(JJ)-Q(JJ))*D1(JJ)                              
       RE=RE+RM(JJ)                                                     
  140  CONTINUE                                                         
       IM=0                                                             
       KAP=XM0                                                          
       MIN=OM-KAP**2                                                    
      IF ( MIN.GT.0 )MIN=DABS(MIN)                                      
      IF ( MIN.LE.0 )GOTO 150                                           
      DO 160 I=M1+1, M                                                  
      IF (DABS(OM-KAP**2).LE.MIN ) THEN                                 
       IMIN=I                                                           
       MIN=DABS(OM-KAP**2)                                              
       END IF                                                           
       KAP=KAP+DELX                                                     
  160  CONTINUE                                                         
       IM=-RP(IMIN)*3.1416                                              
  150  RETURN                                                           
      END                                                               
