
      FUNCTION VOIGT (XX,AA)
	IMPLICIT REAL*8 (A-H,O-Z)
C---	8/29/81 MODIFIED TO ALWAYS RETURN A VALUE GE 1.E-9
C	SEE LAST LINE BEFORE RETURN
C
C---- A QUICK AND DIRTY VOIGT FUNCTION GENERATOR, GOOD TO 3 PLACES OR
C BETTER FOR AA .LT. 0.1
C USES HARRIS EXPANSION UP TO H2
C
      DIMENSION       A(7)       ,B(17)      ,C(12)
      DATA A/-.636619772,-.575045176,-.517467538,-.463663043,
     1 -.413393140,-.366415179,-.322659217 /
      DATA B/-.366415179,-.273927401,-.181624005,-.094625424,
     1 -.016995346,.048484334,.100366097,.138437039,.163505313,
     2 .177120522,.181275706,.178131090,.169787631,.158124873,
     3 .144705210,.130737227,.1168 /
      DATA C/ .318309886,.331066371,.345857391,.363751789,.386756825,
     1 .415509920,.446971438,.476384118,.499908503,.515558594,.522948903
     2 ,.53 /
      DATA C1/.5641895835/
	CALL LIB$FLT_UNDER(1)
      IF (AA.LE.1.) GOTO 102
  101 VOIGT = AA/( 3.1415965*(AA*AA+XX*XX) )
C---	MAKE GE 1.D-9
	VOIGT=DMAX1(VOIGT,1.D-9)
      RETURN
  102 CONTINUE
      AQ = AA
      X = ABS(XX)
      X2 = X**2
      IF (X.GT.0.5) GO TO 103
      XQ = X2/.05
      I = INT(XQ)
      XQ = XQ-I
      I = I+1
      H1 = A(I)+XQ*( A(I+1)-A(I) )
      GO TO 105
  103 IF (X.GT.2.0) GO TO 104
      XQ = (X-.5)/.1
      I = INT(XQ)
      XQ = XQ-I
      I = I+1
      H1 = B(I)+XQ*( B(I+1)-B(I) )
      GO TO 105
  104 YQ = 1./X2
      XQ = YQ/.025
      I = INT(XQ)
      XQ = XQ-I
      I = I+1
      H1 = C(I)+XQ*( C(I+1)-C(I) )
      H1 = H1*YQ
      VOIGT = 0.0
      IF (AQ.LT.1.E-6) GO TO 105
      IF (X.GT.5.) GO TO 106
  105 EXPT = EXP(-X2)
      A2 = AQ**2
      VOIGT = C1*EXPT*( 1.+A2*(1.-2.*X2) )
  106 VOIGT = VOIGT+H1*AQ
	VOIGT=DMAX1(VOIGT,1.D-9)
      RETURN
      END

