*********************************************************

      subroutine emfldspar1(t,x,y,z,bx,by,bz,nStts)

      include 'maxdef.h'

      double precision t,x,y,z,bx,by,bz
      integer nStts

      double precision  b0, dbob
      common /bfield/  b0, dbob

      integer nkmin1d,nkmax1d
      double precision alpha1,lambda_parx,lambda_pary
      double precision eslab,fracx
      common /slabmodel/ eslab,fracx,lambda_parx,lambda_pary,alpha1,
     &                  nkmin1d,nkmax1d
      
      integer nxhalf, nyhalf
      double precision kmin,kmax,xi
      double precision alpha2,lambda_per
      double precision e2d
      common /twodmodel/ e2d,lambda_per,alpha2,kmin,kmax,
     &                  nxhalf,nyhalf,xi
 
      integer iseed_1,iseed_2,iseed_3
      common /seed/ iseed_1,iseed_2,iseed_3

      integer intinput(100)
      common /intinput/ intinput

      double precision dbleinput(100)
      common /dbleinput/ dbleinput

      integer printb
      common /printb/ printb

      double precision alpha3
      common /particle/ alpha3

      double precision th0, ph0
      common /inisph/ th0, ph0

c     LOCALS
c

      double precision rr0

      double precision PI
      parameter (PI = 3.14159265358979323846d0)

      printb  = intinput(1)
      iseed_1 = intinput(2)
      iseed_2 = intinput(3)
      iseed_3 = intinput(4)
      nkmin1d = intinput(5)
      nkmax1d = intinput(6)
      nxhalf  = intinput(7)
      nyhalf  = intinput(8)

      eslab       = dbleinput(1) 
      fracx       = dbleinput(2)
      lambda_parx = dbleinput(3)
      lambda_pary = dbleinput(4)
      alpha1      = dbleinput(5)

      e2d         = dbleinput(6)
      lambda_per  = dbleinput(7)
      alpha2      = dbleinput(8)

      xi          = dbleinput(9)
      kmin        = dbleinput(10)
      kmax        = dbleinput(11)

      alpha3      = dbleinput(12)
      th0         = dbleinput(13)
      ph0         = dbleinput(14)
      rr0         = dbleinput(15)


      bx = 0.0
      by = -b0*dsin(y)
      bz = b0*dsqrt(1.0-dsin(y)*dsin(y))
c      write(*,*)'> bx= ',bx,' by= ',by,' bz= ',bz

      return

      end
