      SUBROUTINE SCAVEC(MXSCA,NSCAT,THETAN,PHIN,CXE01,ENSC,EM1,EM2)
      IMPLICIT NONE
C***********************************************************************
C Given:
C      MXSCA=dimension information for ENSC,PHIN,THETAN
C      NSCAT=number of scattering directions
C      THETAN(1-NSCAT)=scattering angles theta
C      PHIN(1-NSCAT)=scattering angles phi
C      CXE01(1-3)=complex polarization vector 1 (phi=0 direction
C                 is defined by x,y plane (Lab Frame), where incident
C                 radiation propagates along the x axis.
C Returns:
C      ENSC(1-3,1-NSCAT)=scattering vectors in Lab Frame
C      EM1(1-3,1-NSCAT)=scattered pol vectors parallel to scat. plane
C                       in Lab Frame
C      EM2(1-3,1-NSCAT)=scattered pol vectors perp. to scat. plane
C                       in Lab Frame
C It is assumed that incident propagation vector is in x-direction
C in Lab Frame
C
C History:
C 96.11.06 (BTD): Changed definition of scattering angle phi
C                 Previously, phi was measured from plane containing
C                 incident k vector (i.e., Lab x-axis) and Re(CXE01)
C                 Henceforth, phi is measured from Lab x,y plane.
C
C Copyright (C) 1993,1996, B.T. Draine and P.J. Flatau
C This code is covered by the GNU General Public License.
C***********************************************************************
C
C Arguments:
      INTEGER MXSCA,NSCAT
      COMPLEX CXE01(3)
      REAL EM1(3,MXSCA), EM2(3,MXSCA), ENSC(3,MXSCA), PHIN(MXSCA),
     &     THETAN(MXSCA)
C
C Local variables:
      INTEGER I
      REAL COSPHI,COSTHE,SINPHI,SINTHE
C
C***********************************************************************
      DO 1000 I=1,NSCAT
         COSPHI=COS(PHIN(I))
         SINPHI=SIN(PHIN(I))
         COSTHE=COS(THETAN(I))
         SINTHE=SIN(THETAN(I))
         ENSC(1,I)=COSTHE
         ENSC(2,I)=SINTHE*COSPHI
         ENSC(3,I)=SINTHE*SINPHI
         EM1(1,I)=-SINTHE
         EM1(2,I)=COSTHE*COSPHI
         EM1(3,I)=COSTHE*SINPHI
         EM2(1,I)=0.
         EM2(2,I)=-SINPHI
         EM2(3,I)=COSPHI
 1000 CONTINUE
      RETURN
      END
