      SUBROUTINE COMPSM (KIND,OBS0,LEN,C,IC,B)

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      COMMON /CONST/ PI,PI2,RAD,RADSEC,TWOPI

      DIMENSION IC(31), C(31)
      DIMENSION B(*)

      OBS0 = 0.D0
      DO 10 JI = 1, LEN
         OBS0 = OBS0 + C(JI) * B(IC(JI))
   10 CONTINUE

      IF (KIND.EQ.22.OR.KIND.EQ.23) OBS0 = OBS0 * RADSEC

      RETURN
      END
