SUBROUTINE FKLSSM
*-- Author : Stephen Burke
      SUBROUTINE FKLSSM(Z,DZ,SVEC,CVEC,SPRO,QGAIN,QPRO,SSMT,CSMT,IERR)
*-----------------------------------------Updates 07/02/92-------                                             
**: FKLSSM 30205.SB. Remove unused FKECODE sequence.                                                          
*-----------------------------------------Updates----------------                                             
**********************************************************************                                        
*                                                                    *                                        
* Simple Kalman Smoothing                                            *                                        
*                                                                    *                                        
* ERROR CONDITIONS;                                                  *                                        
*       IERR =   0 ; normal termination                              *                                        
*       IERR = 116 ; x, y or theta has silly value                   *                                        
*       IERR =  17 ; tan(theta) > 1 (warning)                        *                                        
*                                                                    *                                        
**********************************************************************                                        
                                                                        
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)                               
                                                                        
      PARAMETER (IUTIL=0,IROUT=13)                                      
                                                                        
      DIMENSION SVEC(5),CVEC(5,5),SPRO(5),QGAIN(5,5),QPRO(5,5)          
     &,         SSMT(5),CSMT(5,5)                                       
      DIMENSION SADJ(5),DINV(5,5),AGAIN(5,5)                            
                                                                        
**********************************************************************                                        
                                                                        
      IERR = 0                                                          
                                                                        
* Adjust the old smoothed vector to allow for MS ...                                                          
      CALL FKADJ(SVEC,SPRO,QGAIN,SADJ)
      CALL FKNORM(SADJ,IFAIL)
      IF (IFAIL.NE.0) CALL FKERR(IUTIL,IROUT,IFAIL/100,IFAIL,IERR)
      IF (IFAIL.GE.100) RETURN                                          
                                                                        
* ... translate to the new position ...                                                                       
      CALL FKTRAN(DZ,Z,SADJ,SSMT,DINV)
      CALL FKNORM(SSMT,IFAIL)
      IF (IFAIL.NE.0) CALL FKERR(IUTIL,IROUT,IFAIL/100,IFAIL,IERR)
      IF (IFAIL.GE.100) RETURN                                          
                                                                        
* ... and calculate the new covariance                                                                        
      CALL FKDMQD(DINV,QGAIN,AGAIN)
      CALL FKMXM(CVEC,AGAIN,CSMT)
      CALL FKDQA(DINV,QPRO,AGAIN,CSMT)
                                                                        
      RETURN                                                            
      END                                                               
*