SOURCE¶
Summary
Invokes the use of a user-defined source routine SOURCE to sample the primary particles.
BEAM, BEAMPOS, POLARIZAti, SPECSOUR, USRICALL, USRGCALLSOURCE. To pass more than 6 parameters, two successive SOURCE cards are required.First card:
- WHAT(1)
…WHAT(6): user parameters to be passed to the
SOURCEroutine as a double precision subarrayWHASOU(1)…WHASOU(6)(viaCOMMON SOURCM).- SDUM
= any user dependent character string (not containing “
&”), to be passed to theSOURCEroutine as a character variableSDUSOU(viaCOMMON CHEPSR).
Continuation card (if present):
- WHAT(1)
…WHAT(6): user parameters to be passed to the
SOURCEroutine as a double precision subarrayWHASOU(7)…WHASOU(12).- SDUM
= “
&” in any position in column 71 to 78 (or in the last field if free format is used)- Default
(option
SOURCEnot given): subroutineSOURCEis not called
Notes
In many simple cases, the primary particle properties can be defined by just two input cards:
BEAMandBEAMPOS. The two options define the type of the particle, its energy/momentum (monoenergetic or simply distributed) and its starting position and direction (also sampled from a few simple distributions centred around the z-axis). A third option,POLARIZAti, can be used to complete the description of the primaries in case they are totally or partially polarised.However, there are more complex situations where the type of primary particles and their phase space coordinates must be sampled from different types of distributions, read from files, or generated by a rule decided by the user. To handle these cases, it is possible to call a user routine
SOURCEwhich can override totally or in part the definitions given in input. The call is activated by optionSOURCE. A default version of the routine, which leaves any other input definition unchanged, is present in the FLUKA library. Instructions on how to write, compile and linkSOURCEare given in SOURCE: user-written source.Even when overridden by
SOURCE, the momentum or kinetic energy defined byWHAT(1)of optionBEAMis meaningful, since it is taken as maximum energy for several scoring facilities and for cross section tabulations. Therefore, it is recommended to input in any case aBEAMcard with the maximum energy expected in the current run.The user has the possibility to write a flexible
SOURCEroutine which can handle different cases without being recompiled and linked. The 12WHASOUoptional double precision parameters and theSDUSOUcharacter string can be combined to provide a multitude of possible options.Initialisations (for instance reading data from files, or spectrum normalisation needed for sampling) can be done in
SOURCEitself, as explained in SOURCE: user-written source, or in two other user routinesUSRINI andUSRGLO.USRINIis called every time a cardUSRICALLis found in input (see USRINI: USeR INItialisation), whileUSRGLOis called before any other initialisation made by FLUKA. Note that more than one primary particle can be sampled in a same call toSOURCEand loaded into stack for later transport. A further user routine,USREIN (see USREIN: USeR Event INitialisation (called before each event)), which is called just afterSOURCEand before the sampled primary (or primaries) are transported, allows the user to do an initialisation at the beginning of each event. An event is defined as all the histories of primaries sampled in a single call toSOURCEand of their descendants. RoutineUSREOU is called instead at the end of each event (see USREOU: USeR Event OUtput (called at the end of each event)).In old versions of FLUKA, the call to
SOURCEwas requested by means of a flag in cardSTART. This feature has been discontinued.
Example 1:
* A user-written SOURCE routine is called without passing any parameter.
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
SOURCE
Example 2:
* Here the user passes to the SOURCE routine 7 numerical values and one
* character string. These can be used as free parameters inside the routine,
* or as flags/switches to select between different options
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
SOURCE 12.58 1.0 -14. 0.987651 100. 365.FLAG18
SOURCE 999.2 &