      PROGRAM LSTFLT1T                                                          
C                                                                               
C     AUTHOR            D.R.POWELL                                              
C     LAST MODIFIED     9/2/82                                                  
C                                                                               
C     THIS PROGRAM TESTS THE SUBROUTINE 'LSTFLT'                                
C     WRITING IS TO LOGICAL UNIT 7                                              
C     ASSUMES THAT LOGICAL UNIT 10 IS UNASSIGNED.                               
C                                                                               
$INCLUDE SPLANE10.CMN(NLIST)                                                    
$INCLUDE ZPLANE10.CMN(NLIST)                                                    
C                                                                               
      CHARACTER*56         CHR56                                                
      REAL*4               SPEC(100),ZSPEC(100)                                 
C                                                                               
      DATA SPEC/100*0.0/                                                        
      DATA ZSPEC/100*0.0/                                                       
C                                                                               
C     INITIALISE FOR ERROR REPORTING                                            
C     ******************************                                            
C                                                                               
      CALL UERSET('LSTFLT1T','W','E','N')                                       
      CALL UERLU(7)                                                             
C                                                                               
C                                                                               
C     TEST(1):CALL LSTFLT WITH LOGICAL UNIT < 1                                 
C     *****************************************                                 
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,1000)                                                             
      CALL LSTFLT(-1,SPEC,'TEST(1)')                                            
      CALL UERREP('TESTFILT',1,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(2):CALL LSTFLT WITH LENGTH OF TITLE > 55                             
C     *********************************************                             
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,2000)                                                             
C                                                                               
C     Set up header values.                                                     
      SPEC(PSL)=100                                                             
      SPEC(PSU)=0                                                               
      SPEC(PSX)=PSV                                                             
      SPEC(PSN)=1                                                               
C                                                                               
      CALL LSTFLT(7,SPEC,CHR56)                                                 
      CALL UERREP('TESTFILT',2,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(3):CALL LSTFLT WITH UNKNOWN SINGULARITY TYPE                         
C     *************************************************                         
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,3000)                                                             
C     Set up unknown singularity.                                               
C                                                                               
C     Set up header values.                                                     
      SPEC(PSL)=100                                                             
      SPEC(PSU)=0                                                               
      SPEC(PSX)=PSV                                                             
      SPEC(PSN)=2                                                               
C                                                                               
      IP=PSH+1                                                                  
C     Set up first correct singularity:-                                        
C           With     POSITION = (1.0,0.0)                                       
C                    GAIN     = 2.0+j3.0                                        
C             and    TYPE     = REAL POLE                                       
      SPEC(IP+PSM)=1                                                            
      SPEC(IP+PST)=PSTRP                                                        
      SPEC(IP+PSG)=2.0                                                          
      SPEC(IP+PSJ)=3.0                                                          
      SPEC(IP+PSR)=1.0                                                          
      SPEC(IP+PSI)=0.0                                                          
C                                                                               
C     Set up second incorrect singularity type.                                 
      IP=PSH+1+PSE                                                              
      SPEC(IP+PSM)=2                                                            
      SPEC(IP+PST)=10  ;UNKNOWN SING TYPE                                       
      SPEC(IP+PSG)=2.0                                                          
      SPEC(IP+PSJ)=3.0                                                          
      SPEC(IP+PSR)=1.0                                                          
      SPEC(IP+PSI)=0.0                                                          
C                                                                               
C                                                                               
      CALL LSTFLT(7,SPEC,'TEST(3)')                                             
      CALL UERREP('TESTFILT',3,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(4):CALL LSTFLT WITH UNKNOWN Z-PLANE SING. TYPE                       
C     ***************************************************                       
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,4000)                                                             
C     Set up unknown singularity.                                               
C     First set up correct singularity.                                         
      ZSPEC(PZL)=100                                                            
      ZSPEC(PZU)=0                                                              
      ZSPEC(PZX)=PZV                                                            
      ZSPEC(PZN)=2                                                              
C                                                                               
      IP=PZH+1                                                                  
C     Set up first correct singularity:-                                        
C           With     POSITION = (1.0,0.0)                                       
C                    GAIN     = 2.0+j3.0                                        
C             and    TYPE     = REAL POLE                                       
      ZSPEC(IP+PZM)=1                                                           
      ZSPEC(IP+PZT)=PZTRP                                                       
      ZSPEC(IP+PZG)=2.0                                                         
      ZSPEC(IP+PZJ)=3.0                                                         
      ZSPEC(IP+PZR)=1.0                                                         
      ZSPEC(IP+PZI)=0.0                                                         
C                                                                               
C     Set up second incorrect singularity type.                                 
      IP=PZH+1+PZE                                                              
      ZSPEC(IP+PZM)=2                                                           
      ZSPEC(IP+PZT)=10  ;UNKNOWN SING TYPE                                      
      ZSPEC(IP+PZG)=1.0                                                         
      ZSPEC(IP+PZJ)=3.0                                                         
      ZSPEC(IP+PZR)=1.0                                                         
      ZSPEC(IP+PZI)=0.0                                                         
C                                                                               
C                                                                               
      CALL LSTFLT(7,ZSPEC,'TEST(4)')                                            
      CALL UERREP('TESTFILT',4,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(5):CALL LSTFLT WITH UNKNOWN ARRAY TYPE                               
C     *******************************************                               
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,5000)                                                             
      SPEC(PSL)=100                                                             
      SPEC(PSU)=100                                                             
      SPEC(PSX)=50                                                              
      SPEC(PSN)=1                                                               
C                                                                               
      CALL LSTFLT(7,SPEC,'TEST(5)')                                             
      CALL UERREP('TESTFILT',5,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(6):CALL LSTFLT WITH UNASSIGNED LOGICAL UNIT                          
C     ************************************************                          
C                                                                               
C     Zero the array                                                            
      DO 1111 I=1,100                                                           
          SPEC(I)=0.0                                                           
          ZSPEC(I)=0.0                                                          
1111  CONTINUE                                                                  
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,6000)                                                             
      SPEC(PSL)=100                                                             
      SPEC(PSU)=0                                                               
      SPEC(PSX)=PSV                                                             
      SPEC(PSN)=1                                                               
C                                                                               
C     Create singularity                                                        
      IP=PSH+1                                                                  
      SPEC(IP+PSM)=1                                                            
      SPEC(IP+PST)=PSTRZ                                                        
      SPEC(IP+PSG)=1.0                                                          
      SPEC(IP+PSJ)=2.0                                                          
      SPEC(IP+PSR)=3.0                                                          
      SPEC(IP+PSI)=4.0                                                          
C                                                                               
      CALL LSTFLT(10,SPEC,'TEST(6)')                                            
      CALL UERREP('TESTFILT',6,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(7):CALL LSTFLT WITH ALL POSSIBLE SING TYPES                          
C     ************************************************                          
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,7000)                                                             
      SPEC(PSL)=100                                                             
      SPEC(PSU)=99                                                              
      SPEC(PSX)=PSV                                                             
      SPEC(PSN)=6                                                               
C                                                                               
C     Real Zero.                                                                
      IP=PSH+1                                                                  
      SPEC(IP+PSM)=1                                                            
      SPEC(IP+PST)=PSTRZ                                                        
      SPEC(IP+PSG)=1.0                                                          
      SPEC(IP+PSJ)=1.1                                                          
      SPEC(IP+PSR)=1.2                                                          
      SPEC(IP+PSI)=1.3                                                          
C                                                                               
C     Real Pole.                                                                
      IP=PSH+1+PSE*1                                                            
      SPEC(IP+PSM)=2                                                            
      SPEC(IP+PST)=PSTRP                                                        
      SPEC(IP+PSG)=2.0                                                          
      SPEC(IP+PSJ)=2.1                                                          
      SPEC(IP+PSR)=2.2                                                          
      SPEC(IP+PSI)=2.3                                                          
C                                                                               
C     Complex Zero.                                                             
      IP=PSH+1+PSE*2                                                            
      SPEC(IP+PSM)=3                                                            
      SPEC(IP+PST)=PSTCZ                                                        
      SPEC(IP+PSG)=3.0                                                          
      SPEC(IP+PSJ)=3.1                                                          
      SPEC(IP+PSR)=3.2                                                          
      SPEC(IP+PSI)=3.3                                                          
C                                                                               
C     Complex Pole.                                                             
      IP=PSH+1+PSE*3                                                            
      SPEC(IP+PSM)=4                                                            
      SPEC(IP+PST)=PSTCP                                                        
      SPEC(IP+PSG)=4.0                                                          
      SPEC(IP+PSJ)=4.1                                                          
      SPEC(IP+PSR)=4.2                                                          
      SPEC(IP+PSI)=4.3                                                          
C                                                                               
C     Complex conjugate Zero pair.                                              
      IP=PSH+1+PSE*4                                                            
      SPEC(IP+PSM)=5                                                            
      SPEC(IP+PST)=PST2Z                                                        
      SPEC(IP+PSG)=5.0                                                          
      SPEC(IP+PSJ)=5.1                                                          
      SPEC(IP+PSR)=5.2                                                          
      SPEC(IP+PSI)=5.3                                                          
C                                                                               
C     Complex conjugate Pole pair.                                              
      IP=PSH+1+PSE*5                                                            
      SPEC(IP+PSM)=6                                                            
      SPEC(IP+PST)=PST2P                                                        
      SPEC(IP+PSG)=6.0                                                          
      SPEC(IP+PSJ)=6.1                                                          
      SPEC(IP+PSR)=6.2                                                          
      SPEC(IP+PSI)=6.3                                                          
C                                                                               
      CALL LSTFLT(7,SPEC,'TEST(7)')                                             
      CALL UERREP('TESTFILT',7,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
C                                                                               
C     TEST(8):CALL LSTFLT WITH CORRECT Z-PLANE SPEC                             
C     *********************************************                             
C                                                                               
      WRITE(7,100)                                                              
      WRITE(7,8000)                                                             
      ZSPEC(PZL)=100                                                            
      ZSPEC(PZU)=99                                                             
      ZSPEC(PZX)=PZV                                                            
      ZSPEC(PZN)=6                                                              
C                                                                               
C     Real Zero.                                                                
      IP=PZH+1                                                                  
      ZSPEC(IP+PZM)=1                                                           
      ZSPEC(IP+PZT)=PZTRZ                                                       
      ZSPEC(IP+PZG)=1.0                                                         
      ZSPEC(IP+PZJ)=1.1                                                         
      ZSPEC(IP+PZR)=1.2                                                         
      ZSPEC(IP+PZI)=1.3                                                         
C                                                                               
C     Real Pole.                                                                
      IP=PZH+1+PZE*1                                                            
      ZSPEC(IP+PZM)=2                                                           
      ZSPEC(IP+PZT)=PZTRP                                                       
      ZSPEC(IP+PZG)=2.0                                                         
      ZSPEC(IP+PZJ)=2.1                                                         
      ZSPEC(IP+PZR)=2.2                                                         
      ZSPEC(IP+PZI)=2.3                                                         
C                                                                               
C     Complex Zero.                                                             
      IP=PZH+1+PZE*2                                                            
      ZSPEC(IP+PZM)=3                                                           
      ZSPEC(IP+PZT)=PZTCZ                                                       
      ZSPEC(IP+PZG)=3.0                                                         
      ZSPEC(IP+PZJ)=3.1                                                         
      ZSPEC(IP+PZR)=3.2                                                         
      ZSPEC(IP+PZI)=3.3                                                         
C                                                                               
C     Complex Pole.                                                             
      IP=PZH+1+PZE*3                                                            
      ZSPEC(IP+PZM)=4                                                           
      ZSPEC(IP+PZT)=PZTCP                                                       
      ZSPEC(IP+PZG)=4.0                                                         
      ZSPEC(IP+PZJ)=4.1                                                         
      ZSPEC(IP+PZR)=4.2                                                         
      ZSPEC(IP+PZI)=4.3                                                         
C                                                                               
C     Complex conjugate Zero pair.                                              
      IP=PZH+1+PZE*4                                                            
      ZSPEC(IP+PZM)=5                                                           
      ZSPEC(IP+PZT)=PZT2Z                                                       
      ZSPEC(IP+PZG)=5.0                                                         
      ZSPEC(IP+PZJ)=5.1                                                         
      ZSPEC(IP+PSR)=5.2                                                         
      ZSPEC(IP+PZI)=5.3                                                         
C                                                                               
C     Complex conjugate Pole pair.                                              
      IP=PZH+1+PZE*5                                                            
      ZSPEC(IP+PZM)=6                                                           
      ZSPEC(IP+PZT)=PZT2P                                                       
      ZSPEC(IP+PZG)=6.0                                                         
      ZSPEC(IP+PZJ)=6.1                                                         
      ZSPEC(IP+PZR)=6.2                                                         
      ZSPEC(IP+PZI)=6.3                                                         
C                                                                               
      CALL LSTFLT(7,ZSPEC,'TEST(8)')                                            
      CALL UERREP('TESTFILT',8,.FALSE.)                                         
      CALL UERCLR                                                               
C                                                                               
100   FORMAT(X,//)                                                              
1000  FORMAT(X,'TEST(1):CALL OF LSTFLT WITH LU < 1')                            
2000  FORMAT(X,'TEST(2):CALL OF LSTFLT WITH LEN (TITLE)>55')                    
3000  FORMAT(X,'TEST(3):CALL LSTFLT WITH UNKNOWN SING TYPE (S)')                
4000  FORMAT(X,'TEST(4):CALL LSTFLT WITH UNKNOWN SING TYPE (Z)')                
5000  FORMAT(X,'TEST(5):CALL LSRFLT WITH UNKNOWN ARRAY TYPE')                   
6000  FORMAT(X,'TEST(6):CALL LSTFLT WITH UNASSIGNED LU')                        
7000  FORMAT(X,'TEST(7):CALL LSTFLT - CORRECT S PLANE SET UP')                  
8000  FORMAT(X,'TEST(8):CALL LSTFLT - CORRECT Z PLANE SET UP')                  
C                                                                               
C                                                                               
      STOP                                                                      
      END                                                                       
