defines a detector for a boundary crossing fluence or current
estimator
(see also USRBIN, USRCOLL, USRTRACK, USRYIELD)
The full definition of the detector may require two successive cards
(the second card, identified by the character '&' in any column from
71 to 78, must be given unless the corresponding defaults are
acceptable to the user)
First card:
WHAT(1) = i1 + i2 * 10 + i3 * 100, where i1, i2 i3 have the following
meaning:
i1 = 1.0 : linear binning in energy and solid angle
= -1.0 : logarithmic binning in energy, linear in solid angle
= 2.0 : logarithmic binning in solid angle, linear in energy
= -2.0 : logarithmic binning in energy and solid angle
i2 = 0.0 : one way scoring
= +1.0 : two-way scoring
i3 = 0.0 : current scoring
= +1.0 : fluence scoring (inverse cosine-weighted)
Default = 1.0 (one-way current, linear in energy and solid
angle)
WHAT(2) = (generalised) particle type to be scored
Default = 201.0 (all particles)
WHAT(3) = logical output unit
> 0.0 : formatted data are written on WHAT(3) unit
< 0.0 : unformatted data are written on |WHAT(3)| unit
Values of |WHAT(1)| < 21 should be avoided (with the
exception of +11).
Default = 11.0 (standard output unit)
WHAT(4) = first region defining the boundary
(in case of one-way scoring this is the upstream region)
Default = 1.0
WHAT(5) = second region defining the boundary
(in case of one-way scoring this is the downstream region)
Default = 2.0
WHAT(6) = area of the detector in cm**2
Default = 1.0
SDUM = any character string (not containing '&') identifying the
detector
Continuation card:
WHAT(1) = maximum kinetic energy for scoring (GeV)
Default: Beam particle total energy as set by the BEAM
option (if no BEAM card is given, the energy corresponding
to 200 GeV/c momentum will be used)
WHAT(2) = minimum kinetic energy for scoring (GeV)
Default = 0.0 if linear energy binning, 0.001 GeV
otherwise
WHAT(3) = number of energy intervals for scoring
Default = 10.0
WHAT(4) = maximum solid angle for scoring in sr
Default = 2 pi for one-way estimators, 4 pi for two-way
WHAT(5) = If linear angular binning: minimum solid angle for
scoring (sr)
Default = 0.0
If logarithmic angular binning: solid angle of the first
bin (sr)
Default = 0.001
WHAT(6) = number of angular bins
Default = 1.0 for linear angular binning, 3.0 otherwise
SDUM = & in any position in column 71 to 78
Default (option USRBDX not given): no boundary crossing estimator
IMPORTANT!
----------
Note: The results of a USRBDX boundary crossing estimator are
always given as DOUBLE DIFFERENTIAL distributions of
fluence (or current) in energy and solid angle, in units
of cm-2 GeV-1 sr-1 per incident primary, EVEN WHEN ONLY
1 INTERVAL (BIN) HAS BEEN REQUESTED, which is often
the case for angular distributions.
Thus, for example, when requesting a fluence or current energy
spectrum, with no angular distribution, to obtain INTEGRAL
BINNED results (fluence or current in cm-2 PER ENERGY BIN per
primary) one must multiply the value of each energy bin by the
width of the bin (even for logarithmic binning), AND BY 2 pi
or 4 pi (depending on whether one-way or two-way scoring has
been requested).
Angular distributions must be intended as distributions in
cos(theta), where theta is the angle between the particle
trajectory and the normal to the boundary at the point of
crossing.
When logarithmic scoring is requested for angular distributions,
all intervals have all the same logarithmic width (equal ratio
between upper and lower limit of the interval), EXCEPT THE FIRST
ONE. The limits of the first angular interval are theta = 0 and
the value indicated by the user with WHAT(5) in the second
USRBDX card.
If the generalised particle is 208.0 or 211.0, the quantity
scored is differential energy fluence (if cosine-weighted) or
differential energy current (energy crossing the surface). In
both cases the quantity will be expressed in GeV per cm2 per
energy unit per steradian per primary. That can sometimes lead to
confusion since GeV cm-2 GeV-1 sr-1 = cm-2 sr-1, where energy
does not appear. Note that integrating over energy and solid
angle one gets GeV/cm2.
The maximum number of boundary crossing detectors that the
user can define is 1100. This value can be changed by modifying
the parameter MXUSBX in member USRBDX of the flukaadd library
or directory and then re-compiling and linking FLUKA.
The logical output unit for the estimator results (WHAT(3) of
the first USRBDX card) can be any one of the following:
- the standard output unit 11: estimator results will be
written on the same file as the standard FLUKA output
- a pre-connected unit (via a symbolic link on most UNIX systems,
ASSIGN under VMS, or equivalent commands on other systems)
- a file opened with the FLUKA command OPEN
- a file opened with a Fortran OPEN statement in a user-written
initialisation routine such as USRINI or SOURCE (see 13})
- a dynamically opened file, with a default name assigned by the
Fortran compiler (typically fort.xx or ftn.xx, with xx equal
to the chosen logical output unit number).
The results of several USRBDX detectors in a same FLUKA run can
be written on the same file, but of course only if they are all
in the same mode (all formatted, or all unformatted).
It is also possible in principle to write on the same file the
results of different kinds of estimators (USRTRACK, USRBIN, etc.)
but this is not recommended, especially in the case of an
unformatted file, because it would make very difficult any reading
and analysis.
When scoring neutron fluence or current, and the requested
energy bin structure overlaps with that of the low energy
neutron groups, bin boundaries are forced to coincide with
group boundaries and no bin can be smaller than the
corresponding group.
Actually, the program uses the requested energy limits and
number of bins to estimate the desired bin width. The number
of bins above the upper limit of the first low-energy neutron
group is recalculated according to such width.
Note that the energy limits of the thermal neutron group
are 1.E-14 GeV (1.E-5 eV) and 4.14E-10 GeV (0.414 eV) for the
ENEA data sets. All group energy boundaries are listed in
a Table in 10}.
An example on how to read USRBDX unformatted output
is given below. An explanation of the meaning of the
different variables is given in the comments at the beginning
of the program. The program lists the bin energy boundaries
(in increasing order) for each angular interval, and the
corresponding differential and cumulative fluence (energy-integrated
within each angle interval, and integrated over both energy and
angle).
A more complex program USXSUW, which allows to compute also
standard deviations over several runs, is available with the
normal FLUKA code distribution in directory $FLUPRO/flutil.
PROGRAM RDBDX
*----------------------------------------------------------------------
* Up to MXUSBX user-defined bdrx detectors are allowed
*
* ABXHGH = maximum angle (steradian) (WHAT(4) of 2nd card)
* ABXLOW = minimum angle (steradian) (WHAT(5) of 2nd card)
* AUSBDX = area (cm**2) of the detector (WHAT(6) of first card)
* DABXBN = angular bin width (steradian) if linear in angle,
* otherwise ratio between upper and lower edge of angular
* intervals
* DEBXBN = energy bin width (GeV) if linear in energy or referring
* to a low-energy neutron energy group, otherwise
* ratio between upper and lower edge of energy intervals
* EBXHGH = maximum energy (GeV) (WHAT(1) of 2nd card)
* EBXLOW = minimum energy (GeV) (WHAT(2) of 2nd card)
* ENGMAX = upper energies (GeV) of the neutron groups
* IDUSBX = (generalized) particle scored (WHAT(2) of first card)
* IGMUSX = maximum low-energy neutron group to be scored
* ITUSBX = type of binning (i1 in WHAT(1) of first card):
* 1 = linear energy, linear angle
* 2 = linear energy, logarithmic angle,
* -1 = logarithmic energy, linear angle,
* -2 = logarithmic energy, logarithmic angle
* LFUSBX = current if .F., fluence if .T. (i3 in WHAT(1) of card 1)
* LLNUSX = no low energy neutron scoring if false, yes if true
* LWUSBX = one way if false, 2-ways if true (i2 in WHAT(1) of card 1)
* MX = id-number of the boundary crossing detector
* NABXBN = number of angular intervals (WHAT(6) of 2nd card)
* NCASE = number of beam particles followed
* NEBXBN = number of energy intervals
* NR1USX = first region (WHAT(4) of first card)
* NR2USX = second region (WHAT(5) of first card)
* RUNTIM = date and time of the run (as printed on standard output)
* RUNTIT = title of the run (as given by card TITLE)
* SCORED = result array
* TITUSX = detector name (SDUM in first USBDRX card)
* WEIPRI = total weight of primaries
* NHIGH = number of energy bins above low-energy neutron limit
* CUMULE = energy-cumulative fluence/current
* CUMULA = energy-angle-cumulative fluence/current
* ELIMIT = lower energy of the first bin above or straddling the
* n-group limit
*
*----------------------------------------------------------------------
PARAMETER ( MXUSBX = 1500 ) ! max. number of usbdrx detectors
PARAMETER ( MXENER = 1000) ! storage for results
PARAMETER ( MXANGL = 100) !
PARAMETER ( MXSCOR = MXENER*MXANGL )
PARAMETER ( NMXGRP = 100 ) ! # of low-energy neutron groups
LOGICAL LFUSBX, LWUSBX, LLNUSX
CHARACTER RUNTIT*80,RUNTIM*32,TITUSX*10,FILNAM*80
DIMENSION EBXLOW(MXUSBX), EBXHGH(MXUSBX), ABXLOW(MXUSBX),
& ABXHGH(MXUSBX), DEBXBN(MXUSBX), DABXBN(MXUSBX),
& AUSBDX(MXUSBX), NEBXBN(MXUSBX), NABXBN(MXUSBX),
& NR1USX(MXUSBX), NR2USX(MXUSBX), ITUSBX(MXUSBX),
& IDUSBX(MXUSBX), IGMUSX(MXUSBX), LFUSBX(MXUSBX),
& LWUSBX(MXUSBX), LLNUSX(MXUSBX), TITUSX(MXUSBX),
& ENGMAX (NMXGRP+1), SCORED(MXSCOR), ELIMIT(MXUSBX),
& MX(MXUSBX), NHIGH(MXUSBX)
DOUBLE PRECISION CUMUL, ANGINT, EN1, EN2, ELIMIT, DIFF
WRITE(*,*)' Type the name of the input file:'
READ (*,'(A)') FILNAM
LQ = INDEX(FILNAM,' ') - 1
OPEN (UNIT=1, FILE=FILNAM, STATUS='OLD', FORM='UNFORMATTED')
OPEN (UNIT=2, FILE=FILNAM(1:LQ)//'.txt', STATUS='NEW')
*----------- read and write 1st record ---------------------------------
READ (1) RUNTIT,RUNTIM,WEIPRI,NCASE
WRITE(2,100) RUNTIT, RUNTIM, NCASE, WEIPRI
100 FORMAT(/,1X,'*****',2X,A80,2X,'*****',/,/,10X,A32,/,/,
& 10X,'Total number of particles followed ',I9,', for a ',
& 'total weight of ',1P,E15.8,/)
*----------- loop on bdryx detector data in the present file -----------
DO 1 IX = 1, MXUSBX
NX = IX
* ---------------- read and write 2nd record --------------------
READ (1, END=1000) MX(NX), TITUSX(NX), ITUSBX(NX), IDUSBX(NX),
& NR1USX(NX), NR2USX(NX), AUSBDX(NX), LWUSBX(NX), LFUSBX(NX),
& LLNUSX(NX), EBXLOW(NX), EBXHGH(NX), NEBXBN(NX), DEBXBN(NX),
& ABXLOW(NX), ABXHGH(NX), NABXBN(NX), DABXBN(NX)
WRITE(2,101) MX(NX),
& TITUSX(NX), IDUSBX(NX), NR1USX(NX), NR2USX(NX), AUSBDX(NX)
* ------------ if low-en. neutrons, read group energies ---------
IF ( LLNUSX (NX) ) THEN
READ (1) IGMUSX(NX), (ENGMAX(IG), IG = 1, IGMUSX(NX)+1)
WRITE (2,102) IGMUSX(NX)
ELSE
IGMUSX(NX) = 0
END IF
* ---------------------- 1 or 2-way -----------------------------
IF ( LWUSBX (NX) ) THEN
WRITE (2,'(6X,A)') 'this is a two ways estimator'
ELSE
WRITE (2,'(6X,A)') 'this is a one way only estimator'
END IF
* ---------------------- fluence or current ---------------------
IF ( LFUSBX (NX) ) THEN
WRITE (2,'(6X,A)') 'this is a fluence-like estimator'
ELSE
WRITE (2,'(6X,A)') 'this is a current-like estimator'
END IF
* -------------------- linear or log in energy ------------------
IF ( ITUSBX (NX) .GT. 0 ) THEN
WRITE (2,103) EBXLOW(NX), EBXHGH(NX), NEBXBN(NX), DEBXBN(NX)
ELSE
WRITE (2,104) EBXLOW(NX), EBXHGH(NX), NEBXBN(NX), DEBXBN(NX)
END IF
* -------------------- linear or log in angle -------------------
IF ( ABS (ITUSBX (NX)) .LE. 1 ) THEN
WRITE (2,105) ABXLOW(NX), ABXHGH(NX), NABXBN(NX), DABXBN(NX)
ELSE
WRITE (2,106) ABXLOW(NX), ABXHGH(NX), NABXBN(NX), DABXBN(NX)
END IF
* interv = total number of energy intervals
* (intervals above the limit for n-groups + intervals below)
INTERV = NEBXBN(NX) + IGMUSX(NX)
*------------ read the scoring results as a 1-dimensional array --------
READ (1) (SCORED(J), J = 1, INTERV * NABXBN(NX))
*------------ loop on angles -------------------------------------------
CUMUL = 0.D0
DO 2 IA = 1, NABXBN(NX)
IF ( ABS (ITUSBX (NX)) .LE. 1 ) THEN
* linear in angle
WRITE(2,107) IA, ABXLOW(NX) + (IA-1)*DABXBN(NX),
& ABXLOW(NX) + IA*DABXBN(NX)
ELSE
* logarithmic in angle
IF(IA .EQ. 1) THEN
WRITE (2,108) ABXLOW(NX)
ELSE
WRITE (2,107) IA, ABXLOW(NX) * DABXBN(NX)**(IA-1),
& ABXLOW(NX) * DABXBN(NX)**IA
END IF
END IF
WRITE (2,'(" ",
& " Double Differential Angle-Integrated",
& " Cumulative" )')
IF ( LFUSBX (NX) ) THEN
WRITE (2,'(" ",
& " Fluence (dPhi/dE/dOmega) dPhi/dE ",
& " Fluence")')
ELSE
WRITE (2,'(" ",
& " Current (dJ/dE/dOmega) dJ/dE ",
& " Current")')
END IF
WRITE (2,'("Lower energy Upper energy",
& " cm**-2 GeV**-1 sr-1 cm**-2 GeV-1",
& " cm**-2"/)')
ELIMIT(NX) = EBXLOW(NX)
* -------------------- low-energy neutrons -------------------
IF ( LLNUSX (NX) ) THEN
* low-energy neutron data, if present, are stored backwards
IG = IGMUSX(NX)
EN1 = ENGMAX(IG+1)
* ------------- loop on low-energy groups -----------------
DO 3 JG = IA*(NEBXBN(NX)+IGMUSX(NX)),
& IA*(NEBXBN(NX)+IGMUSX(NX)) - IGMUSX(NX) + 1, -1
EN2 = ENGMAX(IG)
ANGINT = SCORED(JG) * DABXBN(NX)
CUMUL = CUMUL + ANGINT * (EN2 - EN1)
WRITE(2,109) EN1, EN2, SCORED(JG), ANGINT, CUMUL
IG = IG - 1
EN1 = EN2
3 CONTINUE ! end loop on low-energy groups
* find lower limit of first bin above or straddling the
* n-group limit. Nhigh: counts the high energy bins
NHIGH(NX) = 0
* for the time being, set energy boundary at n-group limit
ELIMIT(NX) = EN1
EN1 = EBXHGH(NX)
DO 4 IE = 1, NEBXBN(NX)
IF(ITUSBX(NX) .GT. 0) THEN
EN2 = EN1 - DEBXBN(NX)
ELSE
EN2 = EN1 / DEBXBN(NX)
END IF
EN1 = EN2
NHIGH(NX) = NHIGH(NX) + 1
IF(EN2 .LE. ELIMIT(NX)) GO TO 5
4 CONTINUE
5 CONTINUE
ELSE
EN1 = EBXLOW(NX)
NHIGH(NX) = NEBXBN(NX)
END IF
* ------------------------------------------------------------
* first bin above or straddling the n-group limit
IF(ITUSBX(NX) .GT. 0) THEN
EN2 = EN1 + DEBXBN(NX)
ELSE
EN2 = EN1 * DEBXBN(NX)
END IF
DIFF = SCORED(IA * (NEBXBN(NX)) - NHIGH(NX) + 1)
ANGINT = DIFF * DABXBN(NX)
CUMUL = CUMUL + ANGINT * (EN2 - ELIMIT(NX))
WRITE(2,109) ELIMIT(NX), EN2, DIFF, ANGINT, CUMUL
EN1 = EN2
* -------- loop on energies above the n-group limit ----------
DO 6 IE = 2, NHIGH(NX)
IF(ITUSBX(NX) .GT. 0) THEN
EN2 = EN1 + DEBXBN(NX)
ELSE
EN2 = EN1 * DEBXBN(NX)
END IF
DIFF = SCORED(IA * (NEBXBN(NX)) - NHIGH(NX) + IE)
ANGINT = DIFF * DABXBN(NX)
CUMUL = CUMUL + ANGINT * (EN2 - EN1)
WRITE(2,109) EN1, EN2, DIFF, ANGINT, CUMUL
EN1 = EN2
6 CONTINUE ! end loop on energies above limit
* Case of generalized particles .ne. 8 but including neutrons
IF (LLNUSX(NX) .AND. IDUSBX(NX) .NE. 8 .AND.
& NEBXBN(NX) .GT. NHIGH(NX)) THEN
WRITE(2,110) ELIMIT(NX)
EN1 = EBXLOW(NX)
DO 7 IE = 1, NEBXBN(NX) - NHIGH(NX)
IF(ITUSBX(NX) .GT. 0) THEN
EN2 = EN1 + DEBXBN(NX)
ELSE
EN2 = EN1 * DEBXBN(NX)
END IF
DIFF = SCORED(IA * (NEBXBN(NX)) - NHIGH(NX) + IE)
DIFF = SCORED((IA-1) * (NEBXBN(NX)+IGMUSX(NX)) + IE)
ANGINT = DIFF * DABXBN(NX)
CUMUL = CUMUL + ANGINT * (EN2 - EN1)
WRITE(2,109) EN1, EN2, DIFF, CUMULE, CUMULA
EN1 = EN2
7 CONTINUE
END IF
* ------------------------------------------------------------
2 CONTINUE ! end loop on angles
* ---------------------------------------------------------------
1 CONTINUE ! end loop on detectors
* ------------------------------------------------------------------
1000 CONTINUE
101 FORMAT(/,3X,'Bdrx n. ',I3,' "',A10,
& '" , generalized particle n. ',I4,', from region n. ',I6,
& ' to region n. ',I6,/,6X,'detector area: ',1P,E15.8,' cm**2')
102 FORMAT(6X,'low energy neutrons scored from group 1 to group ', I5)
103 FORMAT(6X,'linear energy binning from ',1P,E11.4,' to ',
& E11.4,' GeV, ',0P,I6,' bins (',1P,E11.4,' GeV wide)')
104 FORMAT(6X,'logar. energy binning from ',1P,E11.4,' to ',
& E11.4,' GeV, ',0P,I6,' bins (ratio :',1P,E11.4,')')
105 FORMAT(6X,'linear angular binning from ',1P,E11.4,' to ',
& E11.4,' sr , ',0P,I6,' bins (',1P,E11.4,' sr wide )'/)
106 FORMAT(6X,'logar. angular binning, first bin = ',1P,E11.4,
& ' sr, upper limit ',E11.4,' sr, ',0P,I6,' bins ( ratio :',
& 1P,E11.4,')'/)
107 FORMAT(/' Angle ',I4,' between ',1P,E11.4,' and ',E11.4,' sr'/)
108 FORMAT(/' Angle 1 between 0 and ',1P,E11.4, ' sr'/)
109 FORMAT(1P, 2(E11.4, 7X), 3(E14.7, 8X))
110 FORMAT(/,20X,"Particles other than neutrons below E = ",1P,E11.4/)
END
Example:
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7...+...8
USRBDX 101.0 9.0 21.0 3.0 4.0 400.0 AntiNeu
USRBDX 5.0 0.0 200.0 0.0 0.0 0.0 &
* Calculate fluence spectrum from 0 to 5 GeV, in 200 linear energy intervals,
* of antineutrons passing from region 3 to region 4 (and not from 4 to 3).
* Write formatted results on unit 21. The area of the boundary is 400 cm2.
* A single angular interval is requested (from 0 to 2pi)