
C LAST UPDATE:
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C*****************************
C**    LSM_MULTFUN_SIG      **
C*****************************
C
C **** LSM SERVICE ROUTINE ONLY ****
C
      SUBROUTINE LSM_MULTFUN_SIG(M,N,FVECC,X)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose : calculates function for least square refinement for
C           sigmas of multiples components
C
C Author:  Steffi Arzt, John Campbell, July 1997
C
C Arguments:
C
      INCLUDE 'limits.finc'
      INCLUDE 'deconv.finc'
      INTEGER M, N
      DOUBLE PRECISION FVECC(M),X(N)
C
C Parameters:
C  M       i  (R)   Number of functions (= no. of equivalent reflections)
C  N       i  (R)   Number of paramters to be refined
C  FVECC   dp (W)   An array, dimensioned to at least M, returning
C                  the M values of f(j), j=1...M calculated using
C                  the refined parameter values.
C  X       dp (R)   Array containing the parameters to be refined
C
C
C====== PARAMETERS:
C
C
C====== LOCALS:
C
      INTEGER I, J

      DO 100 I = 1, M
         FVECC(I) = 0.0D0
         DO 50 J = 1, N
            FVECC(I) = FVECC(I) + COEF(I,J)*X(J)
50       CONTINUE
         FVECC(I) = FVECC(I) - AFF(I)
         FVECC(I) = FVECC(I)*SQRT(WT(I))
100   CONTINUE
      RETURN
      END
