*$ CREATE SOURCE.FOR
*COPY SOURCE
*
*=== source ===========================================================*
*
      SUBROUTINE SOURCE ( NOMORE )

      INCLUDE '(DBLPRC)'
      INCLUDE '(DIMPAR)'
      INCLUDE '(IOUNIT)'
*
*----------------------------------------------------------------------*
*                                                                      *
*     Copyright (C) 1990-2006      by    Alfredo Ferrari & Paola Sala  *
*     All Rights Reserved.                                             *
*                                                                      *
*                                                                      *
*     New source for FLUKA9x-FLUKA200x:                                *
*                                                                      *
*     Created on 07 january 1990   by    Alfredo Ferrari & Paola Sala  *
*                                                   Infn - Milan       *
*                                                                      *
*     Last change on 03-mar-06     by    Alfredo Ferrari               *
*                                                                      *
*  This is just an example of a possible user written source routine.  *
*  note that the beam card still has some meaning - in the scoring the *
*  maximum momentum used in deciding the binning is taken from the     *
*  beam momentum.  Other beam card parameters are obsolete.            *
*                                                                      *
*----------------------------------------------------------------------*
*
      INCLUDE '(BEAMCM)'
      INCLUDE '(FHEAVY)'
      INCLUDE '(FLKSTK)'
      INCLUDE '(IOIOCM)'
      INCLUDE '(LTCLCM)'
      INCLUDE '(PAPROP)'
      INCLUDE '(SOURCM)'
      INCLUDE '(SUMCOU)'
*
      LOGICAL LFIRST
*
      SAVE LFIRST
      DATA LFIRST / .TRUE. /
*======================================================================*
*                                                                      *
*                 BASIC VERSION                                        *
*                                                                      *
*======================================================================*
      NOMORE = 0
*  +-------------------------------------------------------------------*
*  |  First call initializations:
      IF ( LFIRST ) THEN
*  |  *** The following 3 cards are mandatory ***
         TKESUM = ZERZER
         LFIRST = .FALSE.
         LUSSRC = .TRUE.
*  |  *** User initialization ***
      END IF
*  |
*  +-------------------------------------------------------------------*
*  Push one source particle to the stack. Note that you could as well
*  push many but this way we reserve a maximum amount of space in the
*  stack for the secondaries to be generated
* Npflka is the stack counter: of course any time source is called it
* must be =0
      NPFLKA = NPFLKA + 1
* Wt is the weight of the particle
      WTFLK  (NPFLKA) = ONEONE
      WEIPRI = WEIPRI + WTFLK (NPFLKA)
* Particle type (1=proton.....). Ijbeam is the type set by the BEAM
* card
*  +-------------------------------------------------------------------*
*  |  (Radioactive) isotope:
      IF ( IJBEAM .EQ. -2 .AND. LRDBEA ) THEN
         IARES  = IPROA
         IZRES  = IPROZ
         IISRES = IPROM
         CALL STISBM ( IARES, IZRES, IISRES )
         IJHION = IPROZ  * 1000 + IPROA
         IJHION = IJHION * 100 + KXHEAV
         IONID  = IJHION
         CALL DCDION ( IONID )
         CALL SETION ( IONID )
*  |
*  +-------------------------------------------------------------------*
*  |  Heavy ion:
      ELSE IF ( IJBEAM .EQ. -2 ) THEN
         IJHION = IPROZ  * 1000 + IPROA
         IJHION = IJHION * 100 + KXHEAV
         IONID  = IJHION
         CALL DCDION ( IONID )
         CALL SETION ( IONID )
         ILOFLK (NPFLKA) = IJHION
*  |  Flag this is prompt radiation
         LRADDC (NPFLKA) = .FALSE.
*  |
*  +-------------------------------------------------------------------*
*  |  Normal hadron:
      ELSE
         IONID = IJBEAM
         ILOFLK (NPFLKA) = IJBEAM
*  |  Flag this is prompt radiation
         LRADDC (NPFLKA) = .FALSE.
      END IF
*  |
*  +-------------------------------------------------------------------*
* From this point .....
* Particle generation (1 for primaries)
      LOFLK  (NPFLKA) = 1
* User dependent flag:
      LOUSE  (NPFLKA) = 0
* User dependent spare variables:
      DO 100 ISPR = 1, MKBMX1
         SPAREK (ISPR,NPFLKA) = ZERZER
 100  CONTINUE
* User dependent spare flags:
      DO 200 ISPR = 1, MKBMX2
         ISPARK (ISPR,NPFLKA) = 0
 200  CONTINUE
* Save the track number of the stack particle:
      ISPARK (MKBMX2,NPFLKA) = NPFLKA
      NPARMA = NPARMA + 1
      NUMPAR (NPFLKA) = NPARMA
      NEVENT (NPFLKA) = 0
      DFNEAR (NPFLKA) = +ZERZER
* ... to this point: don't change anything
* Particle age (s)
      AGESTK (NPFLKA) = +ZERZER
      AKNSHR (NPFLKA) = -TWOTWO
* Group number for "low" energy neutrons, set to 0 anyway
      IGROUP (NPFLKA) = 0


* Nombre alÃ©atoire compris entre 0 et 1 :
       
      ALEA = FLRNDM(XDUMMY)

*
*
* angle 0°
*
*

* source 0° n 1
  		
      IF ( ALEA .LE. ( 4.456741E-03 ) ) THEN
     
      ENSAMP = 1

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 2

      ELSEIF ( ALEA .LE. 1.007295E-02 ) THEN 
       
      ENSAMP = 1.98

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 3

      ELSEIF ( ALEA .LE. 1.673994E-02 ) THEN 
       
      ENSAMP = 2.95

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 4

      ELSEIF ( ALEA .LE. 2.482006E-02 ) THEN 
       
      ENSAMP = 3.93

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 5

      ELSEIF ( ALEA .LE. 3.482054E-02 ) THEN 
       
      ENSAMP = 4.9

      COSX = 0
      COSY = 0
      COSZ = 1
* source 0° n 6

      ELSEIF ( ALEA .LE. 4.681389E-02 ) THEN 
       
      ENSAMP = 5.88

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 7

      ELSEIF ( ALEA .LE. 6.090876E-02 ) THEN 
       
      ENSAMP = 6.85

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 8

      ELSEIF ( ALEA .LE. 7.659791E-02 ) THEN 
       
      ENSAMP = 7.83

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 9

      ELSEIF ( ALEA .LE. 9.341032E-02 ) THEN 
       
      ENSAMP = 8.8

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 10

      ELSEIF ( ALEA .LE. 1.110199E-01 ) THEN 
       
      ENSAMP = 9.78

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 11

      ELSEIF ( ALEA .LE. 1.294266E-01 ) THEN 
       
      ENSAMP = 10.8

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 12

      ELSEIF ( ALEA .LE. 1.477246E-01 ) THEN 
       
      ENSAMP = 11.7


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 13

      ELSEIF ( ALEA .LE. 1.658052E-01 ) THEN 
       
      ENSAMP = 12.7


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 14

      ELSEIF ( ALEA .LE. 1.834872E-01 ) THEN 
       
      ENSAMP = 13.7


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 15

      ELSEIF ( ALEA .LE. 2.006619E-01 ) THEN 
       
      ENSAMP = 14.7


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 16

      ELSEIF ( ALEA .LE. 2.167497E-01 ) THEN 
       
      ENSAMP = 15.6


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 17

      ELSEIF ( ALEA .LE. 2.319678E-01 ) THEN 
       
      ENSAMP = 16.6


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 18

      ELSEIF ( ALEA .LE. 2.462439E-01 ) THEN 
       
      ENSAMP = 17.6


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 19

      ELSEIF ( ALEA .LE. 2.595054E-01 ) THEN 
       
      ENSAMP = 18.6


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 20

      ELSEIF ( ALEA .LE. 2.717887E-01 ) THEN 
       
      ENSAMP = 19.5


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 21

      ELSEIF ( ALEA .LE. 2.830573E-01 ) THEN 
       
      ENSAMP = 20.5


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 22

      ELSEIF ( ALEA .LE. 2.933839E-01 ) THEN 
       
      ENSAMP = 21.5


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 23

      ELSEIF ( ALEA .LE. 3.027322E-01 ) THEN 
       
      ENSAMP = 22.5


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 24

      ELSEIF ( ALEA .LE. 3.111384E-01 ) THEN 
       
      ENSAMP = 23.4


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 25

      ELSEIF ( ALEA .LE. 3.187112E-01 ) THEN 
       
      ENSAMP = 24.4


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 26

      ELSEIF ( ALEA .LE. 3.255957E-01 ) THEN 
       
      ENSAMP = 25.4


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 27

      ELSEIF ( ALEA .LE. 3.317916E-01 ) THEN 
       
      ENSAMP = 26.4

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 28

      ELSEIF ( ALEA .LE. 3.373716E-01 ) THEN 
       
      ENSAMP = 27.3


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 29

      ELSEIF ( ALEA .LE. 3.422994E-01 ) THEN 
       
      ENSAMP = 28.3


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 30

      ELSEIF ( ALEA .LE. 3.466836E-01 ) THEN 
       
      ENSAMP = 29.3


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 31

      ELSEIF ( ALEA .LE. 3.505607E-01 ) THEN 
       
      ENSAMP = 30.3


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 32

      ELSEIF ( ALEA .LE. 3.540065E-01 ) THEN 
       
      ENSAMP = 31.2


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 33

      ELSEIF ( ALEA .LE. 3.570247E-01 ) THEN 
       
      ENSAMP = 32.2


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 34

      ELSEIF ( ALEA .LE. 3.596480E-01 ) THEN 
       
      ENSAMP = 33.2

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 35

      ELSEIF ( ALEA .LE. 3.618547E-01 ) THEN 
       
      ENSAMP = 34.2



      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 36

      ELSEIF ( ALEA .LE. 3.638004E-01 ) THEN 
       
      ENSAMP = 35.1


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 37

      ELSEIF ( ALEA .LE. 3.654019E-01 ) THEN 
       
      ENSAMP = 36.1

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 38

      ELSEIF ( ALEA .LE. 3.667535E-01 ) THEN 
       
      ENSAMP = 37.1

      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 39

      ELSEIF ( ALEA .LE. 3.678658E-01 ) THEN 
       
      ENSAMP = 38.1


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 40

      ELSEIF ( ALEA .LE. 3.687970E-01 ) THEN 
       
      ENSAMP = 39


      COSX = 0
      COSY = 0
      COSZ = 1

* source 0° n 41

      ELSEIF ( ALEA .LE. 3.695833E-01 ) THEN 
       
      ENSAMP = 40

      COSX = 0
      COSY = 0
      COSZ = 1


*
*
* angle 30°
*
*

* source 30° n 1

      ELSEIF ( ALEA .LE. 3.762865E-01 ) THEN 
       
      ENSAMP = 1

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038




* source 30° n 2

      ELSEIF ( ALEA .LE. 3.844753E-01 ) THEN 
       
      ENSAMP = 1.98

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 3

      ELSEIF ( ALEA .LE. 3.938236E-01 ) THEN 
       
      ENSAMP = 2.95

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 4

      ELSEIF ( ALEA .LE. 4.042951E-01 ) THEN 
       
      ENSAMP = 3.93

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 5

      ELSEIF ( ALEA .LE. 4.168682E-01 ) THEN 
       
      ENSAMP = 4.9

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038


* source 30° n 6

      ELSEIF ( ALEA .LE. 4.312892E-01 ) THEN 
       
      ENSAMP = 5.88

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 7

      ELSEIF ( ALEA .LE. 4.471958E-01 ) THEN 
       
      ENSAMP = 6.85

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 8

      ELSEIF ( ALEA .LE. 4.637546E-01 ) THEN 
       
      ENSAMP = 7.83

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 9

      ELSEIF ( ALEA .LE. 4.808206E-01 ) THEN 
       
      ENSAMP = 8.8

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 10

      ELSEIF ( ALEA .LE. 4.979954E-01 ) THEN 
       
      ENSAMP = 9.78

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 11

      ELSEIF ( ALEA .LE. 5.145904E-01 ) THEN 
       
      ENSAMP = 10.8

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 12

      ELSEIF ( ALEA .LE. 5.304970E-01 ) THEN 
       
      ENSAMP = 11.7


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 13

      ELSEIF ( ALEA .LE. 5.457877E-01 ) THEN 
       
      ENSAMP = 12.7


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 14

      ELSEIF ( ALEA .LE. 5.600637E-01 ) THEN 
       
      ENSAMP = 13.7


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 15

      ELSEIF ( ALEA .LE. 5.729629E-01 ) THEN 
       
      ENSAMP = 14.7


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 16

      ELSEIF ( ALEA .LE. 5.844490E-01 ) THEN 
       
      ENSAMP = 15.6


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 17

      ELSEIF ( ALEA .LE. 5.947031E-01 ) THEN 
       
      ENSAMP = 16.6


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 18

      ELSEIF ( ALEA .LE. 6.038702E-01 ) THEN 
       
      ENSAMP = 17.6


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 19

      ELSEIF ( ALEA .LE. 6.119865E-01 ) THEN 
       
      ENSAMP = 18.6


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 20

      ELSEIF ( ALEA .LE. 6.191245E-01 ) THEN 
       
      ENSAMP = 19.5


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 21

      ELSEIF ( ALEA .LE. 6.253567E-01 ) THEN 
       
      ENSAMP = 20.5


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 22

      ELSEIF ( ALEA .LE. 6.307918E-01 ) THEN 
       
      ENSAMP = 21.5


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 23

      ELSEIF ( ALEA .LE. 6.355746E-01 ) THEN 
       
      ENSAMP = 22.5


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 24

      ELSEIF ( ALEA .LE. 6.396690E-01 ) THEN 
       
      ENSAMP = 23.4


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 25

      ELSEIF ( ALEA .LE. 6.432634E-01 ) THEN 
       
      ENSAMP = 24.4


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 26

      ELSEIF ( ALEA .LE. 6.463577E-01 ) THEN 
       
      ENSAMP = 25.4


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 27

      ELSEIF ( ALEA .LE. 6.490499E-01 ) THEN 
       
      ENSAMP = 26.4

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 28

      ELSEIF ( ALEA .LE. 6.514304E-01 ) THEN 
       
      ENSAMP = 27.3


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 29

      ELSEIF ( ALEA .LE. 6.535030E-01 ) THEN 
       
      ENSAMP = 28.3


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 30

      ELSEIF ( ALEA .LE. 6.552966E-01 ) THEN 
       
      ENSAMP = 29.3


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 31

      ELSEIF ( ALEA .LE. 6.568003E-01 ) THEN 
       
      ENSAMP = 30.3


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 32

      ELSEIF ( ALEA .LE. 6.581119E-01 ) THEN 
       
      ENSAMP = 31.2


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 33

      ELSEIF ( ALEA .LE. 6.592605E-01 ) THEN 
       
      ENSAMP = 32.2


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 34

      ELSEIF ( ALEA .LE. 6.602388E-01 ) THEN 
       
      ENSAMP = 33.2

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 35

      ELSEIF ( ALEA .LE. 6.610722E-01 ) THEN 
       
      ENSAMP = 34.2



      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 36

      ELSEIF ( ALEA .LE. 6.617824E-01 ) THEN 
       
      ENSAMP = 35.1


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 37

      ELSEIF ( ALEA .LE. 6.624020E-01 ) THEN 
       
      ENSAMP = 36.1

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 38

      ELSEIF ( ALEA .LE. 6.629346E-01 ) THEN 
       
      ENSAMP = 37.1

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 39

      ELSEIF ( ALEA .LE. 6.633875E-01 ) THEN 
       
      ENSAMP = 38.1


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 40

      ELSEIF ( ALEA .LE. 6.637752E-01 ) THEN 
       
      ENSAMP = 39


      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038



* source 30° n 41

      ELSEIF ( ALEA .LE. 6.641046E-01 ) THEN 
       
      ENSAMP = 40

      COSX = 0
      COSY = 0.5
      COSZ = 0.8660254038




*
*
* angle 50°
*
*


* source 50° n 1

      ELSEIF ( ALEA .LE. 6.734166E-01 ) THEN 
       
      ENSAMP = 1

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 2

      ELSEIF ( ALEA .LE. 6.843592E-01 ) THEN 
       
      ENSAMP = 1.98

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 3

      ELSEIF ( ALEA .LE. 6.960265E-01 ) THEN 
       
      ENSAMP = 2.95

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 4

      ELSEIF ( ALEA .LE. 7.076938E-01 ) THEN 
       
      ENSAMP = 3.93

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 5

      ELSEIF ( ALEA .LE. 7.202669E-01 ) THEN 
       
      ENSAMP = 4.9

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788

* source 50° n 6

      ELSEIF ( ALEA .LE. 7.331660E-01 ) THEN 
       
      ENSAMP = 5.88

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 7

      ELSEIF ( ALEA .LE. 7.455580E-01 ) THEN 
       
      ENSAMP = 6.85

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 8

      ELSEIF ( ALEA .LE. 7.574064E-01 ) THEN 
       
      ENSAMP = 7.83

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 9

      ELSEIF ( ALEA .LE. 7.682765E-01 ) THEN 
       
      ENSAMP = 8.8

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 10

      ELSEIF ( ALEA .LE. 7.778784E-01 ) THEN 
       
      ENSAMP = 9.78

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 11

      ELSEIF ( ALEA .LE. 7.862846E-01 ) THEN 
       
      ENSAMP = 10.8

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 12

      ELSEIF ( ALEA .LE. 7.933864E-01 ) THEN 
       
      ENSAMP = 11.7


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 13

      ELSEIF ( ALEA .LE. 7.994736E-01 ) THEN 
       
      ENSAMP = 12.7


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 14

      ELSEIF ( ALEA .LE. 8.045826E-01 ) THEN 
       
      ENSAMP = 13.7


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 15

      ELSEIF ( ALEA .LE. 8.088581E-01 ) THEN 
       
      ENSAMP = 14.7


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 16

      ELSEIF ( ALEA .LE. 8.124235E-01 ) THEN 
       
      ENSAMP = 15.6


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 17

      ELSEIF ( ALEA .LE. 8.154998E-01 ) THEN 
       
      ENSAMP = 16.6


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 18

      ELSEIF ( ALEA .LE. 8.181521E-01 ) THEN 
       
      ENSAMP = 17.6


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 19

      ELSEIF ( ALEA .LE. 8.204529E-01 ) THEN 
       
      ENSAMP = 18.6


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 20

      ELSEIF ( ALEA .LE. 8.224711E-01 ) THEN 
       
      ENSAMP = 19.5


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 21

      ELSEIF ( ALEA .LE. 8.242212E-01 ) THEN 
       
      ENSAMP = 20.5


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 22

      ELSEIF ( ALEA .LE. 8.257647E-01 ) THEN 
       
      ENSAMP = 21.5


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 23

      ELSEIF ( ALEA .LE. 8.271018E-01 ) THEN 
       
      ENSAMP = 22.5


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 24

      ELSEIF ( ALEA .LE. 8.282540E-01 ) THEN 
       
      ENSAMP = 23.4


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 25

      ELSEIF ( ALEA .LE. 8.292794E-01 ) THEN 
       
      ENSAMP = 24.4


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 26

      ELSEIF ( ALEA .LE. 8.302287E-01 ) THEN 
       
      ENSAMP = 25.4


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 27

      ELSEIF ( ALEA .LE. 8.310585E-01 ) THEN 
       
      ENSAMP = 26.4

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 28

      ELSEIF ( ALEA .LE. 8.317687E-01 ) THEN 
       
      ENSAMP = 27.3


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 29

      ELSEIF ( ALEA .LE. 8.324064E-01 ) THEN 
       
      ENSAMP = 28.3


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 30

      ELSEIF ( ALEA .LE. 8.329499E-01 ) THEN 
       
      ENSAMP = 29.3


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 31

      ELSEIF ( ALEA .LE. 8.334173E-01 ) THEN 
       
      ENSAMP = 30.3


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 32

      ELSEIF ( ALEA .LE. 8.338122E-01 ) THEN 
       
      ENSAMP = 31.2


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 33

      ELSEIF ( ALEA .LE. 8.341710E-01 ) THEN 
       
      ENSAMP = 32.2


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 34

      ELSEIF ( ALEA .LE. 8.344742E-01 ) THEN 
       
      ENSAMP = 33.2

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 35

      ELSEIF ( ALEA .LE. 8.347098E-01 ) THEN 
       
      ENSAMP = 34.2



      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 36

      ELSEIF ( ALEA .LE. 8.349253E-01 ) THEN 
       
      ENSAMP = 35.1


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 37

      ELSEIF ( ALEA .LE. 8.351080E-01 ) THEN 
       
      ENSAMP = 36.1

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 38

      ELSEIF ( ALEA .LE. 8.352533E-01 ) THEN 
       
      ENSAMP = 37.1

      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 39

      ELSEIF ( ALEA .LE. 8.353790E-01 ) THEN 
       
      ENSAMP = 38.1


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 40

      ELSEIF ( ALEA .LE. 8.354721E-01 ) THEN 
       
      ENSAMP = 39


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


* source 50° n 41

      ELSEIF ( ALEA .LE. 8.355551E-01 ) THEN 
       
      ENSAMP = 40


      COSX = 0
      COSY = 0.766044
      COSZ = 0.642788


*
*
* angle 90°
*
*

* source 90° n 1

      ELSEIF ( ALEA .LE. 8.573678E-01 ) THEN 
       
      ENSAMP = 1

      COSX = 0
      COSY = 1
      COSZ = 0



* source 90° n 2

      ELSEIF ( ALEA .LE. 8.784558E-01 ) THEN 
       
      ENSAMP = 1.98

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 3

      ELSEIF ( ALEA .LE. 8.958841E-01 ) THEN 
       
      ENSAMP = 2.95

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 4

      ELSEIF ( ALEA .LE. 9.078413E-01 ) THEN 
       
      ENSAMP = 3.93

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 5

      ELSEIF ( ALEA .LE. 9.169359E-01 ) THEN 
       
      ENSAMP = 4.9

      COSX = 0
      COSY = 1
      COSZ = 0
* source 90° n 6

      ELSEIF ( ALEA .LE. 9.237116E-01 ) THEN 
       
      ENSAMP = 5.88

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 7

      ELSEIF ( ALEA .LE. 9.287119E-01 ) THEN 
       
      ENSAMP = 6.85

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 8

      ELSEIF ( ALEA .LE. 9.326976E-01 ) THEN 
       
      ENSAMP = 7.83

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 9

      ELSEIF ( ALEA .LE. 9.357557E-01 ) THEN 
       
      ENSAMP = 8.8

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 10

      ELSEIF ( ALEA .LE. 9.382087E-01 ) THEN 
       
      ENSAMP = 9.78

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 11

      ELSEIF ( ALEA .LE. 9.403066E-01 ) THEN 
       
      ENSAMP = 10.8

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 12

      ELSEIF ( ALEA .LE. 9.419625E-01 ) THEN 
       
      ENSAMP = 11.7


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 13

      ELSEIF ( ALEA .LE. 9.432452E-01 ) THEN 
       
      ENSAMP = 12.7


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 14

      ELSEIF ( ALEA .LE. 9.442670E-01 ) THEN 
       
      ENSAMP = 13.7


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 15

      ELSEIF ( ALEA .LE. 9.451112E-01 ) THEN 
       
      ENSAMP = 14.7


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 16

      ELSEIF ( ALEA .LE. 9.457634E-01 ) THEN 
       
      ENSAMP = 15.6


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 17

      ELSEIF ( ALEA .LE. 9.463142E-01 ) THEN 
       
      ENSAMP = 16.6


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 18

      ELSEIF ( ALEA .LE. 9.467635E-01 ) THEN 
       
      ENSAMP = 17.6


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 19

      ELSEIF ( ALEA .LE. 9.471367E-01 ) THEN 
       
      ENSAMP = 18.6


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 20

      ELSEIF ( ALEA .LE. 9.474736E-01 ) THEN 
       
      ENSAMP = 19.5


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 21

      ELSEIF ( ALEA .LE. 9.477534E-01 ) THEN 
       
      ENSAMP = 20.5


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 22

      ELSEIF ( ALEA .LE. 9.479961E-01 ) THEN 
       
      ENSAMP = 21.5


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 23

      ELSEIF ( ALEA .LE. 9.481954E-01 ) THEN 
       
      ENSAMP = 22.5


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 24

      ELSEIF ( ALEA .LE. 9.483679E-01 ) THEN 
       
      ENSAMP = 23.4


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 25

      ELSEIF ( ALEA .LE. 9.485208E-01 ) THEN 
       
      ENSAMP = 24.4


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 26

      ELSEIF ( ALEA .LE. 9.486389E-01 ) THEN 
       
      ENSAMP = 25.4


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 27

      ELSEIF ( ALEA .LE. 9.487520E-01 ) THEN 
       
      ENSAMP = 26.4

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 28

      ELSEIF ( ALEA .LE. 9.488563E-01 ) THEN 
       
      ENSAMP = 27.3


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 29

      ELSEIF ( ALEA .LE. 9.489571E-01 ) THEN 
       
      ENSAMP = 28.3


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 30

      ELSEIF ( ALEA .LE. 9.490346E-01 ) THEN 
       
      ENSAMP = 29.3


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 31

      ELSEIF ( ALEA .LE. 9.490973E-01 ) THEN 
       
      ENSAMP = 30.3


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 32

      ELSEIF ( ALEA .LE. 9.491516E-01 ) THEN 
       
      ENSAMP = 31.2


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 33

      ELSEIF ( ALEA .LE. 9.491947E-01 ) THEN 
       
      ENSAMP = 32.2


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 34

      ELSEIF ( ALEA .LE. 9.492246E-01 ) THEN 
       
      ENSAMP = 33.2

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 35

      ELSEIF ( ALEA .LE. 9.492470E-01 ) THEN 
       
      ENSAMP = 34.2



      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 36

      ELSEIF ( ALEA .LE. 9.492608E-01 ) THEN 
       
      ENSAMP = 35.1


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 37

      ELSEIF ( ALEA .LE. 9.492759E-01 ) THEN 
       
      ENSAMP = 36.1

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 38

      ELSEIF ( ALEA .LE. 9.492828E-01 ) THEN 
       
      ENSAMP = 37.1

      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 39

      ELSEIF ( ALEA .LE. 9.492894E-01 ) THEN 
       
      ENSAMP = 38.1


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 40

      ELSEIF ( ALEA .LE. 9.492953E-01 ) THEN 
       
      ENSAMP = 39


      COSX = 0
      COSY = 1
      COSZ = 0

* source 90° n 41

      ELSEIF ( ALEA .LE. 9.492989E-01 ) THEN 
       
      ENSAMP = 40


      COSX = 0
      COSY = 1
      COSZ = 0

*
*
* angle 180°
*
*
* source 180° n 1

      ELSEIF ( ALEA .LE. 9.549876E-01 ) THEN 
       
      ENSAMP = 1

      COSX = 0
      COSY = 0
      COSZ = -1



* source 180° n 2

            ELSEIF ( ALEA .LE. 9.612198E-01 ) THEN 
       
      ENSAMP = 1.98

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 3

      ELSEIF ( ALEA .LE. 9.673795E-01 ) THEN 
       
      ENSAMP = 2.95

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 4

      ELSEIF ( ALEA .LE. 9.728145E-01 ) THEN 
       
      ENSAMP = 3.93

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 5

      ELSEIF ( ALEA .LE. 9.775612E-01 ) THEN 
       
      ENSAMP = 4.9

      COSX = 0
      COSY = 0
      COSZ = -1
* source 180° n 6

      ELSEIF ( ALEA .LE. 9.813657E-01) THEN 
       
      ENSAMP = 5.88

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 7

      ELSEIF ( ALEA .LE. 9.844057E-01  ) THEN 
       
      ENSAMP = 6.85

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 8

      ELSEIF ( ALEA .LE. 9.870254E-01 ) THEN 
       
      ENSAMP = 7.83

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 9

      ELSEIF ( ALEA .LE. 9.890255E-01 ) THEN 
       
      ENSAMP = 8.8

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 10

      ELSEIF ( ALEA .LE. 9.906198E-01 ) THEN 
       
      ENSAMP = 9.78

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 11

      ELSEIF ( ALEA .LE. 9.920800E-01 ) THEN 
       
      ENSAMP = 10.8

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 12

      ELSEIF ( ALEA .LE. 9.932938E-01 ) THEN 
       
      ENSAMP = 11.7


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 13

      ELSEIF ( ALEA .LE. 9.942757E-01 ) THEN 
       
      ENSAMP = 12.7


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 14

      ELSEIF ( ALEA .LE. 9.951091E-01 ) THEN 
       
      ENSAMP = 13.7


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 15

      ELSEIF ( ALEA .LE. 9.957867E-01 ) THEN 
       
      ENSAMP = 14.7


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 16

      ELSEIF ( ALEA .LE. 9.963302E-01 ) THEN 
       
      ENSAMP = 15.6


      COSX = 0
      COSY = 0.8660254038
      COSZ = -1

* source 180° n 17

      ELSEIF ( ALEA .LE. 9.968157E-01 ) THEN 
       
      ENSAMP = 16.6


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 18

      ELSEIF ( ALEA .LE. 9.972324E-01 ) THEN 
       
      ENSAMP = 17.6


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 19

      ELSEIF ( ALEA .LE. 9.975984E-01 ) THEN 
       
      ENSAMP = 18.6


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 20

      ELSEIF ( ALEA .LE. 9.979111E-01 ) THEN 
       
      ENSAMP = 19.5


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 21

      ELSEIF ( ALEA .LE. 9.981951E-01 ) THEN 
       
      ENSAMP = 20.5


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 22

      ELSEIF ( ALEA .LE. 9.984397E-01 ) THEN 
       
      ENSAMP = 21.5


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 23

      ELSEIF ( ALEA .LE. 9.986524E-01 ) THEN 
       
      ENSAMP = 22.5


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 24

      ELSEIF ( ALEA .LE. 9.988347E-01 ) THEN 
       
      ENSAMP = 23.4


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 25

      ELSEIF ( ALEA .LE. 9.989984E-01 ) THEN 
       
      ENSAMP = 24.4


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 26

      ELSEIF ( ALEA .LE. 9.991448E-01 ) THEN 
       
      ENSAMP = 25.4


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 27

      ELSEIF ( ALEA .LE. 9.992702E-01 ) THEN 
       
      ENSAMP = 26.4

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 28

      ELSEIF ( ALEA .LE. 9.994021E-01 ) THEN 
       
      ENSAMP = 27.3


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 29

      ELSEIF ( ALEA .LE. 9.995158E-01 ) THEN 
       
      ENSAMP = 28.3


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 30

      ELSEIF ( ALEA .LE. 9.996155E-01 ) THEN 
       
      ENSAMP = 29.3


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 31

      ELSEIF ( ALEA .LE. 9.996934E-01 ) THEN 
       
      ENSAMP = 30.3


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 32

      ELSEIF ( ALEA .LE. 9.997593E-01 ) THEN 
       
      ENSAMP = 31.2


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 33

      ELSEIF ( ALEA .LE. 9.998148E-01 ) THEN 
       
      ENSAMP = 32.2


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 34

      ELSEIF ( ALEA .LE. 9.998612E-01 ) THEN 
       
      ENSAMP = 33.2

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 35

      ELSEIF ( ALEA .LE. 9.998941E-01 ) THEN 
       
      ENSAMP = 34.2



      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 36

      ELSEIF ( ALEA .LE. 9.999233E-01 ) THEN 
       
      ENSAMP = 35.1


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 37

      ELSEIF ( ALEA .LE. 9.999441E-01 ) THEN 
       
      ENSAMP = 36.1

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 38

      ELSEIF ( ALEA .LE. 9.999659E-01 ) THEN 
       
      ENSAMP = 37.1

      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 39

      ELSEIF ( ALEA .LE. 9.999786E-01 ) THEN 
       
      ENSAMP = 38.1


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 40

      ELSEIF ( ALEA .LE. 9.999916E-01 ) THEN 
       
      ENSAMP = 39


      COSX = 0
      COSY = 0
      COSZ = -1

* source 180° n 41

      ELSE 
       
      ENSAMP = 40

      COSX = 0
      COSY = 0
      COSZ = -1
 
      ENDIF    
* Conversion of ENSAMP (which is in MeV) in Gev, the energy unit of FLUKA
      ENSAMPTRUE = 1E-03 * ENSAMP
* Kinetic energy of the particle (GeV)
      TKEFLK (NPFLKA) = ENSAMPTRUE
* Particle momentum      
      PMOFLK (NPFLKA) = SQRT ( ENSAMPTRUE * ( ENSAMPTRUE + TWOTWO  
     &                * AM (IJBEAM) ) )
   
* Cosines (tx,ty,tz)

      TXFLK  (NPFLKA) = COSX	
      TYFLK  (NPFLKA) = COSY
      TZFLK  (NPFLKA) = COSZ



* Polarization cosines:
      TXPOL  (NPFLKA) = -TWOTWO
      TYPOL  (NPFLKA) = +ZERZER
      TZPOL  (NPFLKA) = +ZERZER
* Particle coordinates

* Call to a gaussian distribution               
          CALL FLNRR2 (RGAUSS1, RGAUSS2)
          XBEAM = RGAUSS1*2/3
          YBEAM = RGAUSS2*1/6
      
          DO WHILE ( (XBEAM**2 + 16*YBEAM**2) .GT. 4. )
             CALL FLNRR2 (RGAUSS1, RGAUSS2)
             XBEAM = RGAUSS1*2/3
             YBEAM = RGAUSS2*1/6  
          END DO

      XFLK   (NPFLKA) = XBEAM
      YFLK   (NPFLKA) = YBEAM	  
      ZFLK   (NPFLKA) = -4
      
*      YFLK   (NPFLKA) = YBEAM
*      ZFLK   (NPFLKA) = ZBEAM
*  Calculate the total kinetic energy of the primaries: don't change
      IF ( ILOFLK (NPFLKA) .EQ. -2 .OR. ILOFLK (NPFLKA) .GT. 100000 )
     &   THEN
         TKESUM = TKESUM + TKEFLK (NPFLKA) * WTFLK (NPFLKA)
      ELSE IF ( ILOFLK (NPFLKA) .NE. 0 ) THEN
         TKESUM = TKESUM + ( TKEFLK (NPFLKA) + AMDISC (ILOFLK(NPFLKA)) )
     &          * WTFLK (NPFLKA)
      ELSE
         TKESUM = TKESUM + TKEFLK (NPFLKA) * WTFLK (NPFLKA)
      END IF
      RADDLY (NPFLKA) = ZERZER
*  Here we ask for the region number of the hitting point.
*     NREG (NPFLKA) = ...
*  The following line makes the starting region search much more
*  robust if particles are starting very close to a boundary:
      CALL GEOCRS ( TXFLK (NPFLKA), TYFLK (NPFLKA), TZFLK (NPFLKA) )
      CALL GEOREG ( XFLK  (NPFLKA), YFLK  (NPFLKA), ZFLK  (NPFLKA),
     &              NRGFLK(NPFLKA), IDISC )
*  Do not change these cards:
      CALL GEOHSM ( NHSPNT (NPFLKA), 1, -11, MLATTC )
      NLATTC (NPFLKA) = MLATTC
      CMPATH (NPFLKA) = ZERZER
      CALL SOEVSV
      RETURN
*=== End of subroutine Source =========================================*
      END



