      SUBROUTINE FGAUSS(X,A,Y,DYDA,NA)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      DIMENSION A(NA),DYDA(NA)

C
C  Modified by CWC to fit absorption lines
C

      Y=0.
      DO 11 I=1,NA-1,3
        ARG=(X-A(I+1))/A(I+2)
        EX=EXP(-ARG**2)
        FAC=A(I)*EX*2.*ARG
        Y=Y+A(I)*EX
        DYDA(I)=-EX
        DYDA(I+1)=-FAC/A(I+2)
        DYDA(I+2)=-FAC*ARG/A(I+2)
11    CONTINUE
      Y = 1.-Y
      RETURN
      END
