FKLXY COMMENTS
*-- Author : S.Burke
      SUBROUTINE FKLXY(XY,CXY,DDZ,SP,CP,SF,CF,CHISQ,IERR)
**********************************************************************                                        
*                                                                    *                                        
* Kalman Filter an x/y point with errors on z                        *                                        
*                                                                    *                                        
* ERROR CONDITIONS;                                                  *                                        
*       IERR =        0 ; normal termination                         *                                        
*   ->  IERR =      107 ; failure to invert measurement covariance   *                                        
*   ->  IERR =      111 ; failure to invert filtered covariance      *                                        
*       IERR =       17 ; tan(theta) > 1 (warning)                   *                                        
*       IERR =       12 ; covariance of filtered residuals n.p.d.    *                                        
*       IERR =  20 +  n ; 2 < n < 10 iterations                      *                                        
*   ->  IERR =      130 ; 10 iterations                              *                                        
*                                                                    *                                        
*   ->  Fatal errors                                                 *                                        
*                                                                    *                                        
* NB Error 12 is not considered fatal, but the chi-sq will be zero   *                                        
*                                                                    *                                        
* Note that after an error 130 the output vectors are defined, but   *                                        
* are not guaranteed to be correct.                                  *                                        
*                                                                    *                                        
**********************************************************************                                        
*KEEP,FKECODE.                                                                                                
*KEND.                                                                                                        
*KEEP,FKNPL.                                                                                                  
*                                                                                                             
* Per-track values can go in H1WORK; note that LTRUE and LFIRST must                                          
* be set at least per event.                                                                                  
*                                                                                                             
* This is about 36k words long; the remaining common blocks are                                               
* about 3.6k in total. Some of this could be in /H1WORK/, but the                                             
* blocks would have to be reorganised.                                                                        
*                                                                                                             
* /FKPROJ/                                                                                                    
* /FKFILT/                                                                                                    
* /FKSMTH/                                                                                                    
* /FKINT/                                                                                                     
* /FKRSID/                                                                                                    
* /FKTRUE/                                                                                                    
* /FKDBG/                                                                                                     
*KEEP,FKFTVX.                                                                                                 
*KEND.                                                                                                        
**********************************************************************                                        
      CALL UCOPY(SP,SS,10)                                                                             
      CALL FKLFXY(SP,CP,WMES,CMES,SF,CF,CHISQ,IFAIL)
      IF (IFAIL.NE.0) CALL FKERR(IUTIL,IROUT,IFAIL/100,IFAIL,IERR)
         CALL UCOPY(SF,SS,10)                                                                          
         CALL FKERR(IUTIL,IROUT,IFATAL,IFREE1,IERR)
      IF (NPASS.GT.2) CALL FKERR(IUTIL,IROUT,IWARN,IFREE+NPASS,IERR)
*