*$ CREATE ELEFLD.FOR
*COPY ELEFLD
*
*=== elefld ===========================================================*
*
      SUBROUTINE ELEFLD ( X, Y, Z, T, ETX, ETY, ETZ, E, NREG, IDISC )

      INCLUDE '(DBLPRU)'
      INCLUDE '(DIMPAR)'
      INCLUDE '(IOUNIT)'
*
*----------------------------------------------------------------------*
*                                                                      *
*     Copyright (C) 1990-2020      by Alberto Fasso`,  Alfredo Ferrari *
*     All Rights Reserved.                  & Paola Sala               *
*                                                                      *
*                                                                      *
*     Created  in     1990         by    Alberto Fasso`                *
*                                                                      *
*                                                                      *
*     Last change on  10-Mar-20    by    Alberto Fasso`                *
*                                          SLAC/USA                    *
*                                                                      *
*                                                                      *
*     Input variables:                                                 *
*            x,y,z = current position                                  *
*            t     = current time                                      *
*            nreg  = current region                                    *
*     Output variables:                                                *
*            etx,ety,etz = cosines of the electric field vector        *
*            E = electric field intensity (MV/m)                       *
*            idisc = set to 1 if the particle has to be discarded      *
*                                                                      *
*                                                                      *
*----------------------------------------------------------------------*
*
      INCLUDE '(BLNKCM)'
      INCLUDE '(CMEMFL)'
      INCLUDE '(TRACKR)'
*  Statement functions: don't include commons belows this line
      INCLUDE '(SFEMFL)'
*
      ETX = ZERZER
      ETY = ZERZER
      ETZ = ONEONE
*  E = 1 MV/m:
      E   = ONEONE
      IF ( .NOT. LELFON (NREG,IPRODC) ) THEN
         WRITE (LUNOUT,*)
     &      ' Elefld called in zone ',NREG,' where there should'
         WRITE (LUNOUT,*)
     &      ' be no electric field. Something is wrong'
         WRITE (LUNERR,*)
     &      ' Elefld called in zone ',NREG,' where there should'
         WRITE (LUNERR,*)
     &      ' be no electric field. Something is wrong'
         IDISC = 1
      END IF
      RETURN
*=== End of subrotuine Elefld ========================================*
      END

