      SUBROUTINE PTSL(YS)                           
      REAL Z1(801 ,5  ),Y(5  ,3)                    
      REAL Z2(801 ,5  )                             
      REAL Z3(801 ,5  )                             
      REAL BF(4005)                                  
      INTEGER NG(5  )                               
      COMPLEX W1(801 ,5  )                          
      COMPLEX W2(801 ,5  )                          
      COMPLEX W3(801 ,5  )                          
      common/hd / bf
      COMMON/HDa/ NG,Y                              
      COMMON/HDb/ Z1,Z2,Z3                          
      COMMON/HDc/ W1,W2,W3                          
      NTP=5
      write(*,*)' ptsl - y:',ys
      DO 7 I=1,NTP                                  
         DY=Y(I,2)-Y(I,1)                           
         E=(YS-Y(I,1))/DY                           
         F=1.-E                                     
         NF=NG(I)                                   
         DO 3 J=1,NF                                
           Z3(J,I)=Z1(J,I)*F+Z2(J,I)*E              
3        W3(J,I)=W1(J,I)*F+W2(J,I)*E                
         Y(I,3)=YS                                  
7     CONTINUE                                      
      WRITE(20)YS                                   
      write(*,*)' ptsl - prim ys:',ys
C-----WRITE(20)((Z3(I,NT),I=1,NG(NT)),NT=1,NTP)     
      K=0                                           
      DO 11 NT=1,3                                  
         NF=NG(NT)                                  
         DO 11 J=1,NF                               
            K=K+1                                   
            BF(K)=Z3(J,NT)                          
11    CONTINUE                                      
      WRITE(20)(BF(I),I=1,K)                        
      write(*,*)' ptsl - sec ys',ys
C-----WRITE(20)((REAL(W3(I,NT)),I=NG(NT)),NT=1,NTP) 
      I=0                                           
      DO 13 NT=1,3                                  
         NF=NG(NT)                                  
         DO 13 J=1,NF                               
            I=I+1                                   
            BF(I)=REAL(W3(J,NT))                    
13    CONTINUE                                      
      WRITE(20)(BF(K),K=1,I)                        
C-----WRITE(20)((AIMAG(W3(I,NT)),I=NG(NT)),NT=1,NTP)
      I=0                                           
      DO 15 NT=1,3                                  
         NF=NG(NT)                                  
         DO 15 J=1,NF                               
            I=I+1                                   
            BF(I)=AIMAG(W3(J,NT))                   
15    CONTINUE                                      
      WRITE(20)(BF(K),K=1,I)                        
      K=0                                           
      DO 17 NT=4,5                                  
      NF=NG(NT)                                     
      DO 17 I=1,NF                                  
      K=K+1                                         
      BF(K)=Z3(I,NT)                                
17    CONTINUE                                      
      WRITE(20)(BF(I),I=1,K)                        
      K=0                                           
      DO 19 NT=4,5                                  
      NF=NG(NT)                                     
      DO 19 I=1,NF                                  
      K=K+1                                         
      BF(K)=REAL(W3(I,NT))                          
19    CONTINUE                                      
      WRITE(20)(BF(I),I=1,K)                        
      RETURN                                        
      END                                           