defines a detector for a track-length fluence estimator
(see also USRBDX, USRBIN, USRCOLL)
The full definition of the detector may require two successive cards
(the second card, identified by the character '&' in any column > 70,
must be given unless the corresponding defaults are accepted)
First card:
WHAT(1) = 1.0 : linear binning in energy
= -1.0 : logarithmic binning in energy
Default = 1.0 (linear binning)
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 = standard output unit
WHAT(4) = region defining the detector
Default = 1.0
WHAT(5) = volume of the detector in cm**3
Default = 1.0
WHAT(6) = number of energy bins
Default = 10.0
SDUM = any character string (not containing '&') identifying the
track-length detector
Continuation card:
WHAT(1) = maximum kinetic energy for scoring
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
(default: 0 if linear binning, 0.001 GeV otherwise)
Note that the energy limits of the thermal neutron group
for the ENEA data set are:
1.E-14 GeV (1.E-5 eV) and 4.14E-10 GeV (0.414 eV)
WHAT(3)..WHAT(6) : not used
SDUM = & in any position in column 71 to 78 (max. 10 characters)
IMPORTANT!
----------
Note: The results of USRTRACK are always given as DIFFERENTIAL
distributions of fluence in energy (cm-2 GeV-1 per incident
primary unit weight), Thus, for example, when requesting a
fluence energy spectrum, to obtain INTEGRAL BINNED results
(fluence 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).
If the generalised particle is 208 or 211, the quantity
scored is differential energy fluence, expressed in GeV per
cm2 per energy unit. That can sometimes lead to confusion
since GeV cm-2 Gev-1 = cm-2, where energy does not appear.
Note that integrating over energy one gets GeV/cm2.
The maximum number of tracklength + collision detectors (see
option USRCOLL) that the user can define is 400. This value
can be changed by modifying the parameter MXUSTC in member
USRTRC of the flukadd library or directory and then
re-compiling and linking FLUKA.
The logical output unit for the estimator results (WHAT(3) of
the first USRTRACK 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 USRTRACK and USRCOLL 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 (USRBDX, 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, 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. To preserve the
requested upper energy limit, the width of the first bin above
the low energy group may be smaller than that of the others.
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 USRTRACK 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 programs lists the bin energy boundaries
(in increasing order) and the corresponding differential and
cumulative (integral) fluence.
A more complex program USTSUW, which allows to compute also
standard deviations over several runs, is available with the
normal FLUKA code distribution in directory $FLUPRO/flutil.
PROGRAM RDTRK
*----------------------------------------------------------------------
* Up to MXUSTC user-defined track or collision detectors are allowed
*
* DETCBN = 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
* ETCHGH = maximum energy (GeV) (WHAT(1) of 2nd card)
* ETCLOW = minimum energy (GeV) (WHAT(2) of 2nd card)
* ELIMIT = lowest energy of regular intervals
* ENGMAX = upper energies (GeV) of the neutron groups
* IDUSTC = (generalised) particle scored (WHAT(2) of first card)
* IGMUTC = maximum low-energy neutron group to be scored
* ITUSTC = type of detector
* 1 = linear energy, tracklength
* 2 = linear energy, collision
* -1 = logarithmic energy, tracklength
* -2 = logarithmic energy, collision
* LLNUTC = no low energy neutron scoring if false, yes if true
* NTC = id-number of the tracklength/collision detector
* NCASE = number of beam particles followed
* NETCBN = number of energy intervals
* NRUSTC = region of the detector (WHAT(4) of first card)
* RUNTIT = title of the run (as given by card TITLE)
* SCORED = result array
* TITUTC = detector name (SDUM in first USRTRACK/USRCOLL card)
* VUSRTC = volume (cm**3) of the detector (WHAT(5) of first card)
* WEIPRI = total weight of primaries
* NHIGH = number of energy bins above low-energy neutron limit
*
*----------------------------------------------------------------------
PARAMETER ( MXUSTC = 1500 ) ! max. number of trk/coll detectors
PARAMETER ( MXSCOR = 1000 ) ! storage for results
PARAMETER ( NMXGRP = 100 ) ! # of low-energy neutron groups
LOGICAL LLNUTC
CHARACTER RUNTIT*80, RUNTIM*32, TITUTC*10, FILNAM*80
DOUBLE PRECISION CUMUL, EN1, EN2
DIMENSION ETCLOW(MXUSTC), ETCHGH(MXUSTC), DETCBN(MXUSTC),
& NETCBN(MXUSTC), NRUSTC(MXUSTC), ITUSTC(MXUSTC),
& IDUSTC(MXUSTC), IGMUTC(MXUSTC), LLNUTC(MXUSTC),
& TITUTC(MXUSTC), VUSRTC(MXUSTC), ENGMAX(NMXGRP+1),
& SCORED(MXSCOR), NTC(MXUSTC)
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
*----------- loop on tracklength detector data in the present file -----
DO 1 IX = 1, MXUSTC
NX = IX
* ---------------- read and write 2nd record --------------------
READ (1, END=1000) NTC(NX), TITUTC(NX), ITUSTC(NX), IDUSTC(NX),
& NRUSTC(NX), VUSRTC(NX), LLNUTC(NX), ETCLOW(NX), ETCHGH(NX),
& NETCBN(NX), DETCBN(NX)
* ------------ tracklength or collision estimator ---------------
IF(ABS(ITUSTC(NX)) .EQ. 1) THEN
WRITE(2,101) NTC(NX),
& TITUTC(NX), IDUSTC(NX), NRUSTC(NX), VUSRTC(NX)
ELSE
WRITE(2,106) NTC(NX),
& TITUTC(NX), IDUSTC(NX), NRUSTC(NX), VUSRTC(NX)
END IF
* ------------ if low-en. neutrons, read group energies ---------
IF ( LLNUTC (NX) ) THEN
READ (1) IGMUTC(NX), (ENGMAX(IG), IG = 1, IGMUTC(NX)+1)
WRITE (2,102) IGMUTC(NX)
ELSE
IGMUTC(NX) = 0
END IF
* -------------------- linear or log in energy ------------------
IF ( ITUSTC (NX) .GT. 0 ) THEN
WRITE (2,103) ETCLOW(NX), ETCHGH(NX), NETCBN(NX), DETCBN(NX)
ELSE
WRITE (2,104) ETCLOW(NX), ETCHGH(NX), NETCBN(NX), DETCBN(NX)
END IF
* interv = total number of energy intervals
* (intervals above the limit for n-groups + intervals below)
INTERV = NETCBN(NX) + IGMUTC(NX)
*------------ read the scoring results as a 1-dimensional array --------
READ (1) (SCORED(J), J = 1, INTERV)
WRITE (2,'(34X,"Differential",8X,"Integral")')
WRITE (2,'(36X,"Fluence",12X,"Fluence")')
WRITE (2,'("Lower energy",4X,"Upper energy",5X,
& "cm**-2 GeV**-1",8X,"cm**-2"/)')
CUMUL = 0.D0
ELIMIT = ETCLOW(NX)
* ---------------------- low-energy neutrons -------------------
IF ( LLNUTC (NX) ) THEN
* low-energy neutron data, if present, are stored backwards
IG = IGMUTC(NX)
EN1 = ENGMAX(IG+1)
* ---------------- loop on low-energy groups ----------------
* (last groups are lowest energies, print them low to high)
DO 2 JG = NETCBN(NX) + IGMUTC(NX), NETCBN(NX) + 1, -1
EN2 = ENGMAX(IG)
CUMUL = CUMUL + (EN2 - EN1) * SCORED(JG)
WRITE(2,105) EN1, EN2, SCORED(JG), CUMUL
IG = IG - 1
EN1 = EN2
2 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 = 0
* set energy boundary at n-group limit
ELIMIT = EN1
EN1 = ETCHGH(NX)
DO 3 IE = 1, NETCBN(NX)
IF(ITUSTC(NX) .GT. 0) THEN
EN2 = EN1 - DETCBN(NX)
ELSE
EN2 = EN1 / DETCBN(NX)
END IF
EN1 = EN2
NHIGH = NHIGH + 1
IF(EN1 .LE. ELIMIT) GO TO 4
3 CONTINUE
4 CONTINUE
ELSE
EN1 = ETCLOW(NX)
NHIGH = NETCBN(NX)
END IF
* ---------------------------------------------------------------
* first bin above or straddling the n-group limit
IF(ITUSTC(NX) .GT. 0) THEN
EN2 = EN1 + DETCBN(NX)
ELSE
EN2 = EN1 * DETCBN(NX)
END IF
CUMUL = CUMUL + (EN2 - ELIMIT) * SCORED(NETCBN(NX) - NHIGH + 1)
WRITE(2,105) ELIMIT, EN2,
& SCORED(NETCBN(NX) - NHIGH + 1), CUMUL
EN1 = EN2
* ----------- loop on energies above the n-group limit ----------
DO 5 IE = 2, NHIGH
IF(ITUSTC(NX) .GT. 0) THEN
EN2 = EN1 + DETCBN(NX)
ELSE
EN2 = EN1 * DETCBN(NX)
END IF
CUMUL = CUMUL + (EN2 - EN1)* SCORED(NETCBN(NX) - NHIGH + IE)
WRITE(2,105) EN1, EN2,SCORED(NETCBN(NX) - NHIGH + IE), CUMUL
EN1 = EN2
5 CONTINUE ! end loop on energies above limit
* Case of generalised particles .ne. 8 but including neutrons
IF (LLNUTC(NX) .AND. IDUSTC(NX) .NE. 8 .AND.
& NETCBN(NX) .GT. NHIGH) THEN
WRITE(2,110) ELIMIT
EN1 = ETCLOW(NX)
DO 7 IE = 1, NETCBN(NX) - NHIGH
IF(ITUSTC(NX) .GT. 0) THEN
EN2 = EN1 + DETCBN(NX)
ELSE
EN2 = EN1 * DETCBN(NX)
END IF
CUMUL=CUMUL+(EN2-EN1)*SCORED(NETCBN(NX)+IGMUTC(NX)+IE)
WRITE(2,105) EN1,EN2, SCORED(NETCBN(NX)+IGMUTC(NX)+IE),
& CUMUL
EN1 = EN2
7 CONTINUE
END IF
* ---------------------------------------------------------------
1 CONTINUE ! end loop on detectors
* ------------------------------------------------------------------
1000 CONTINUE
100 FORMAT(/,1X,'*****',2X,A80,2X,'*****',/,/,10X,A32,/,/,
& 10X,'Total number of particles followed ',I9,', for a ',
& 'total weight of ',1P,E15.8,/)
101 FORMAT(/,3X,'Track n. ',I3,' "',A10,
& '" , generalised particle n. ',I4,', region n. ',I6,
& /,6X,'detector volume: ',1P,E15.8,' cm**3')
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,I5,' bins (',1P,E11.4,' GeV wide)'/)
104 FORMAT (6X,'logar. energy binning from ',1P,E11.4,' to ',
& E11.4,' GeV, ',0P,I5,' bins (ratio :',1P,E11.4,')'/)
105 FORMAT(1P,2(E11.4,5X),2(E14.7,5X))
106 FORMAT(/,3X,'Coll. n. ',I3,' "',A10,
& '" , generalised particle n. ',I4,', region n. ',I6,
& /,6X,'detector volume: ',1P,E15.8,' cm**3')
110 FORMAT(/,20X,"Particles other than neutrons below E = ",1P,E11.4/)
END
Example:
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7...+...8
USRTRACK 1.0 7.0 -24.0 16.0 4500.0 150.PhotFlu
USRTRACK 1.5 0.0 0.0 0.0 0.0 0. &
* Calculate photon fluence spectrum in region 16 from 0 to 1.5 GeV, in
* 150 linear energy intervals. Write unformatted results on
* unit 24. The volume of region 16 is 4500 cm3.