xerey tube radiation may be.specified by providing as many
of the following four data as are available (and in the

the order indicated): (1) anode element, (2) operating
voltage (kV), (3) x-ray take-off angl2 from the tube (in
degrees, with respect to the anode surfac®), and (4) the
thickness of the beryllium window (mm). If not all of these
are input, the remainder will automatically b2 set equal to
-the values most recently input for the missing data. When
the program is start2d (and after a RESET) it assumes (by
default) that data were input for a tungsten-target tube,

at 50 kV, with a 30-degree take-off angle, and a I-mm
beryllium windows for example,

* CONDITIONS 45 45 W 50 30 1

If there is a filter or other absorber (such as an air path)
between the tub? window and the analysis sample, its name
and mass-thickness ( g/ sq cm) may b2 input following the
complete specification of the tubes; for example

* CONDITIONS 45 45 W 50 30 1 AL .07

If the filter is not an element, then it must be a mixture
of elements (2.g., AIR) d2fined in the data file XRDATC.

Another way to specify an incident spectrum, whether
monochromatic, polychromatic, continuous, or a combination
of lines and continuum, is simply to name a spectrum that is
tabulated in th? data file XRDATS. The detailed format for
such a spectrum is described in Appendix D. For example,

* CONDITIONS 45 45 W45C
The filter for a tabulated spectrum is specified as shown:
* CONDITIONS 45 45 W45C AL .07

If the user inputs the word TEMP in the place of a tabulated
spectrum (2.g., in place of W45C), the program will not look
in the data file XRDATS, but will 2xpect the spectrum to be
input on on? card (or line from a terminal) immediately
following the word TEMP (see Appendix D for the required
format). This facility might be useful in calculating the
effects of various simpl?2 polychromatic spectra (as from
isotopes that were not tabulated in XRDATS). For 2xampl:,
to input a spectrum consisting of 3 lines with wav 2] engths
0.2, 0.5, and 0.7 (angstroms) and with relative intensities
6, 4, and 1, on? might use

* CONDITIONS 45 45 TEMP
*3 0.26 0.54 0.71

7


ANNOTATED BIBLIOGRAPHY

Many of the formulas, calculation methods, and data employed
in NRLXRF may be found in the following sources, listed
chronologically:

H.A. Kramers, :
"On the Theory of X-Ray Absorption and of the Continuous
X-Ray Spectrum"
Phil. Mag., 46, pp 836-871 (1923)
(formula. for bremsstrahlung spectrum, as gen 2rat 2d)

R. Glocker and H. Schreiber,
"Quantitative Rontg2nspektralanalyse mit Kalterregung
des Spektrums"
Annalen der Physik, 85, p 1089 (1928)
(primary contribution from homog2neous, thick sampl2s)

AH. Compton,
“The Efficiency of Production of Fluorescent X-rays"
Philosophical Magazine, 8, p 961 (1929) :
(primary contribution from homogeneous samples,
and the correction factor for thin samples)

L. von Hamos,
“On the Determination of Very Small Quantiti2s of
Substances by the X-ray Micro-analys er"
Arkiv for Matematic, Astromomi och Fysik, 3la, p 1 (1945)
(primary contribution from homog2neous samples,
and the corr2ction factor for thin samples)

E. Gillam and H.T. Heal,
"Some Problems in the Analysis of Steels by X-ray
Fluorescence"
British Journal of Applied Physics, 3, p 353 (1952)
(primary and s2condary contributions in thick,
homogen2ous samples)

M. Green and V.E. Cossl2tt,
"The Efficiency of Production of Charact®ristic
X-radiation in Thick Targets of a Pur? El2ment"
Proc. Phys. Soc. 78, pp 1206-1214 (1961)

(intensities of electron-excit2d K lin2s, as generated)

J. Philibert,
X-Ray (Optics and X-Ray Microanalysis
H.H. Pattee, VE. Cossl2tt, and A. Engstrom, eds.,
Academic Pr2ss, New York, pp 379-392 (1963)
(x-ray absorption correction for electron-excit2d x-rays)

28


PH/SR/SR gives the fluorescence intensity in mor? nearly
absolute units — photons per steradian per steradian.

These units are? appropriat? if the Sample intercepts one
steradian of the incident radiation, and if the incident
line intensities are given in units of photons p2r steradian
emitted from the sourc2, and if incident continuum radiation
is given in units of -photons per steradian per angstrom (see
Appendix D). If the incident radiation is 2xpressed in
other units acceptable to the program, th? valu2s under
PH/SR/SR are strictly proportional to the absolute units,
with the same factor applying to all fluorescence lines.
-The program does not treat collimator or slit sizes, crystal
diffraction efficiency, d2tector efficiency, or any air-path
absorption 2tc. between the sample and the detection system.

PH/SR/SR/G values equal the PH/SR/SR values, divided by the
mass per unit area of the fluor2scing element. For very
thick samples, the values under PH/SR/SR/G will be zeros.

Analysis of finite-thickn2ss samples should not be attempted
under the EMPIRICAL method unless all sampl?s (unknown and
standards) have the same thickness. A sample is treated as
a standard if the r2l2vankziptensity has been input and the
complete composition has given. Under EMPIRICAL, the
Program do2s not check that the sampl2 thickness and other
physical characteristics ar? the same as for the unknown
sample, so.th2re? is a posibility of inappropriate sampl2s
being used as standards. The FULL and THEORETICAL methods
avoid this problem by automatically taking account of all
sample characteristics during analysis.

Il. Bulk Particulate? Samples

After the name of a sample, wherever it is input, the user
may input the sampl2-kind PARTICULATE, or an abbreviation
with the sam? first three letters, PAR. Then, theoretical
calculations using that sample will treat it as a bulk,
particulate sample (for loos2 powders, pr2ssed powders,
sintered materials, slurries, environmental particles evenly
distributed randomly in a filter, etc.). Several sample?
characteristics may be input after th? sampol?2 name.

24


SUM <sum>

ERRORS [<sample> ...

<line num <relerr>

<etc>

EMPIRICAL

THEORETICAL

FULL

STEP [<sample> ...
NORMALIZE [ALL

<line num> (<sample> ...
<lin2 num> [ALL

<etc>

MULTIPLIERS <multi> [<mult2> ...
INPUT <in-file>

QUTPUT <out-file>

LIST [<sample> ...

DUMP

BFIXED

BFREE

ELEMENTS

MAC <material> [<el> <line>
MAC <material> [<energy> KEV
MAC <material> [<wavelength> A
TUBE [<el> <kV> <deg> <mm>
(NO) LONG

(NO) PARROT

(NO) REMARKS

(NO) PCT

(NO) FATAL

33


NRLXRF, A FORTRAN. PROGRAM FOR
X-RAY FLUORESCENCE ANALYSIS:

Users’ Reference Manual

INTRODUCTION

The Naval Research Laboratory (NRL) X-ray analysis program
has evolved during a decade of great change in automated
data interpretation. The present program takes advantage of
the fact that computers now can handle large quantities of
data, in a very complex fashion, at a cost that is no more
than what the primitive approaches required just a few years
ago. It is now 2conomically appropriate to include th? more
detailed physical theories, more extensive data for the
fundamental parameters, and mor? sophisticated error analysis.
The automation of these treatments has been so successful
that the program can be run by a technician with no training
in x-ray physics or computer programming. Although this
program was developed on large computers, very similar
versions probably could be implemented on many existing
minicomputers equipped with disk storage (s22 Appendix I).

The design of the program was guided by considerations of
user convenience, computational power, versatility, and
efficiency. The input style is quite user-oriented.

The analyst inputs only the data that distinguish the
problem at hand from other possible problems. A data fil?
provided with the program automatically supplies fundamental
physical parameters (absorption coefficients etc.) as
required. Ordinary problems can be run simply, without any
Knowledge of how to run more complicated problems. The
Program presumes that the probl2ms ar? simpl2, until the
user indicates otherwise:.

Besides the traditional “influence-coefficients" and
“fundamental-parameters" equations, th? program incorporates
Physical theory and num2rical methods developed at NRL for
treating three general types of samples: (1) homog 2n gous
(including secondary fluorescence and a corr2ction for
sample thickness), (2) particulat2 (same 2ffects as for
homogeneous, plus effects of particle sizes, voids size,

and voids fraction), and (3) s@parate particles that do not
shadow each oth2r, as for many environmental samples.


pollution samples 24-27

polychromatic incident radiation 7, 32-34, 43-44
powders 24

precision 15-17, 39

PREDICT (keyword) 6, 13, 18, 23, 26, 27, 32, 54
program modification 53-55

prompting-character 3

propagated errors 17, 39

pure-element standards .8, 13, 23, 42

question mark 9, 13, 25, 36
QUIT (keyword) 3, 32

random errors 15-17, 38-40, 42

raw intensities 10-11

regression 22, 38-40, 42

regression model 22, 38-40

relative x-ray intensity (see RXI)

relative intensities of incident radiation 7, 43-44
REMARKS (k2yword) 19, 33

RESET (keyword) 6-7, 9-12, 14-15, 18-20, 23, 25, 27, 32
rms (root-m2an-squar?) 16, 40

running common problems 3

running costs 1, 14, 21, 38, 46, 53

RXI (relative x-ray intensity)

11, 13, 14, 18, 20, 22, 23, 27, 36, 42
RXI/C 23

sample area (sq cm) 25, 32, 35
sample kinds 1, 23-27, 35

sample names 3, 4-5, 8, 35

sample mass-thickness (g p2r sq cm) 1, 23, 25, 27, 35
scattering 10
secondary fluorescence 1, 37, 41

semicolon 34

SEPARATE (sample kind) 18, 26

sequence numbers in data files 19, 44-46, 49, 51-52
shap2 of calibration relations 38, 42

shapes of particles 26

short form of output 4-5, 15, 18

Signal plus background 10, 32, 36

significant digits 5, 17

simple analysis problems 4-5

simple command (keyword without data) 3, 32-33
SIMULATE (keyword) 13, 20, 32, 53, 54

simulation of stanaards 13, 20, 32, 38-39, 41-42
simulation-regression cycle 39

sintered materials 24

sizes of particles and voids 25-27, 32, 36

size of problems that can be run 37

62


Following is an example file XRDATS, not including the
5-digit card-number and blank that preceed 2ach card-image.
Notice the free use of remarks in the file.

# THIS EXAMPLE FILE CONTAINS CDI09, CR45C, W45C
#— —
cD109 # CADMIUM 109 ISOTOPE SOURCE

1 # NUMBER OF POINTS (CONSIDERING ONLY SILVER KA)
2559 1 # THE WAVELENGTH AND INTENSITY (PHOTONS/STERADIAN)
# ma a ee
CR45C # PHILIPS CR-TARGET FAQ 60/1 AT 45 KV (CP)
# BASED ON MEASUREMENT AND CALCULATION?

# D.B. BROWN, JeV. GILFRICH, AND M.C. PECKERAR,
# JOURNAL OF APPLIED PHYSICS 46, P 4537 (1975)
#
22 # NUMBER OF TABULATED POINTS
2_K LINES$ UNITS: PHOTONS/STERADIAN/ELECTRON
2.0849 8.59E-5 2.2910 51.4E-5
# NOTE? K BETA INTENSITY REVISED BY J.V. GILFRICH
0.27 0.0 # BEGINNING OF CONTINUUM
# UNITS: PHOTONS/STERADI AN/ANGST ROM/ELECTRON
0.32 8.0E-5 0.36 11.2E-5 0.40 13.3E-5 0.45 14,.8E-5
0.50 15.4E-5 0.60 15.2E-5 0.80 13.6E-5 1.00 11.8E-5
1.50 7.1E-5 2.00 4.1E-5 2.07 3.8E-5 2.07 7.6E-5
2.50 5.3E-5 3.00 3.3E-5 3.50 1.9E-5 4.00 0.98E-5
4.50 0.46E-5 5.00 0.19E-5 5.50 0.069E-5 # END OF CONT.

#—— a ee ee

a

W45C PHILIPS W-TARGET FAAQ 60/3.5 AT -45 KV (CP)
BASED ON MEASUREMENT AND CALCULATION#
D.B. BROWN, J.V. GILFRICH, AND M.C. PECKERAR,

JOURNAL OF APPLIED PHYSICS 46, P 4537 (1975)

NUMBER OF TABULATED POINTS
9 L LINES$ UNITS: PHOTONS/STERADIAN/ELECT RON
1.0620 0.139E-5 1.06861 0.185E-5 1.0986 1.22E-5
1.2454 3.06E-5 1.2627 1.00E-5 1.2818 6.63E-5
1.3016 1.,00E-5 1.4776 10.7E-5 1.6782 0.364E-5
0.27 0.0 # BEGINNING OF CONTINUUM

# UNITS: PHOTONS/STERADI AN/ANGSTROM/ELECTRON
0.32 17.5E-5 0.36 31.0E-5 0.40 37.0E-5 0.45 39.3E-5
0.50 38.5E-5 0.60 34.3E-5 0.70 30.0E-5 0.90 22.3E-5
1.02 18.7E-5 1.02 19.8E-5 1.07 18.4E-5 1.07 20.2E-5
1.15 18.0E-5 1.22 16.4E-5 1.22 22.3E-5 1.50 14.9E-5
2.00 6.8E-5 2.50 2.6E-5 # END OF CONTINUUM

Hmm mn wn ee

END # MARKS THE END OF THE SPECTRUM FILE

28

Sh Fh SR th te te

44


Use of Standards to Adjust Theoretical Intensities

The physical theories used here express characteristic line
intensities in terms of sample composition and other
parameters (absorption co2fficients, particle sizes, etc.).
The intensity units us2d are RXI —- the ratio of intensity
from.the sample, divided by the intensity of the same line
from a thick, homogeneous sample of th? pur? 2lement. The
use of these units does not imply that such a pure-element
standard is necessarily measured. Rather, RXI is used so
that a number of experimental paramet2rs will cancel out,
and thus be eliminated from consideration (for example,
x-ray tube current, detector efficiency, and various solid
“ angles).

For each standard that is input, the program calculates the
theoretical RXI’s. Each measured count rate is divided by
the appropriate RXI to produce an “effective pure-el ement
intensity". Since theories (and measurements) ar? not
perfectly accurate, the "effective pur e-element intensity"
for a given line will vary from standard to standard.

For an unknown, the “effective pure-element intensity" to be
used in relating theory and measurement is a weighted
average of the values obtained from the various standards.
The "weights" in this w2ighted. average ar? designed to

favor the values from standards whose intensities are most
like the intensities from the unknown, and the standards

for which the assumed errors in intensities are the smallest.
These two weighting criteria are balanc2d in such a way that
if an unknown happ2nsd to be the same as one of the standards
already measured, then the caclulated composition would be
the same as the composition of that standard, with an
uncertainty corresponding to the uncertainty in intensities.

The treatment just described is the essence of how this
Program represe*nts a continuous blend of regr2ssion and
theoretical approaches. In 2ff2ct, physical theory provides
the "shape" of th? calibration relations, and standards ar?
used to scal2 th? theory to match the experimental reality.
When very few standards are availabl2, or when they are very
different from th? unknown, th2n the burden is on theory to
have the correct "shap2". On the other hand, when 2v2n one?
standard is avaliable that is reasonably similar to the
unknown, then it matters very little what 2rrors might exist
in the theory or in the “fundamental parameters" (such as

X-ray tube output, absorption coefficients,. and fluor2sc2nc?2
yields).

42


APPENDIX G. General Documentation for Implementation

Computer Configuration

The July 1977 version of the program runs on the Naval
Research Laboratory DEC-10 timesharing computer. The
essential hardwar? includes a KAIO processor, a 192K
memory, RPO3 disk drives, and a DC76 communications system.
In addition, a TU20A 9-track tape unit is used to load the
program initially. The operating system is TOPS-10,
version 6.02.

Source Languag?

The program is written in a fairly standard Fortran IV. The
specific compiler used at the Naval R2search Laboratory is
DEC FORTRAN 10, version 4A.

Th? program should be readily convertibl? to many other
large computers whose Fortran compilers accept ANSI Fortran
(American National Standards Institute X3.9-1966) and also
allow the following non-ANSI features: (1) DATA statements
in this program use array names, rather than listing array
elements separately; (2) ENCODE and DECODE are used} however,
these statements may be eliminated and the statements (now
comments) beginning with "C:SCR" used instead — they use a
scratch file, rather than core, for re-writing and
re-reading input datas} (3) this program assumes that no
variable becom?s undefined upon execution of a RETURN
statements; (4) OPEN statements are used to s2t up fil?s and
establish parameters for input/output o»2rations3 analogous
statements would b2 r2quired for different compilers -- the
program contains statements (now comments) beginning with
"CCDC" that are suggested for use on CDC 6400 timesharing.

Memory Required

The July 1977 version of th? program runs in about 58K
36-bit-byt2s of core on the DEC PDP-10 comput2r. The memory
requirements can be reduced significantly by reducing the

sizes of arrays, as d2scribed in comment statements in the
source listing.

Further reduction in core size can be achieved by
2liminating subprograms that ar2 not 2ssantial to the kinds
of problems to be run. App2ndices H and I outline the

program architecture and discuss specific ways to reduc?
core requirements.

48


All free-field input is r2ad initially in subroutine IN2,
which ENCODEs 2ach card-imag? input, using formats that ar?
easily DECODEd. Subroutine IN2 is called only from
subroutine IN. MAIN calls IN only to initializ? various
Parameters. ERROR calls IN only to reset a parameter. DEFD
calls IN only to obtain th? definition of a multielement
componsnt from th? file XRDATC. Besides MAIN, ERROR, and
DEFD, the subprograms that CALL IN and/or DECODE data are
listed below, along with the. routines that call them:

subprogram called from
NEXTQ MAIN
COND NEXTQ (from MAIN)
LINE (from MAIN)
SAMP MAIN

NEXTQ (from MAIN)
SNOKM (from MAIN)
MEAS (from MAIN)

SNORM MAIN

MEAS MAIN

COMP MAIN

SPEC COND (from LINE (from MAIN))

MAC NEXTQ (from MAIN)

DEFIN MAIN

LINE MAIN

SPIN SPEC (from COND (from LINE (from MAIN)))

All keywords are read and checked through NEXTQ, which acts

directly on many of th? simple commands, and which also
handles data associated with some keywords. Most data ar?
checked in through the other subprograms list2d above.

52


Regression Methods

This outline of the regression methods parallels the outline
given earlier for the usual oraphical procedure,

First, one has standards — i.e., given compositions and
corresponding intensities. For EMPIRICAL analysis, these
are the user-defined standards; for the FULL option, they
are simulated standards whose intensities are forced to be
consistent with the real standards most like the unknown.

Second, on® has a regression model —- i.2., a mathematical
expression used to approximate the known data, especially in
the composition range of interest. The model used in this
program was devised for its mathematical properties; in many
cases, it is very similar to th2 expression used by Lachance
(1964) and others. The model expresses intensity as a
nonlinear function of weight fractions and other param ?2t2rs.
One way of expressing the model is given in Section 9

(page 22), under COEFFICIENTS.

Third, one has a method for fitting the mod2l to the
available data, in order to calculate values for the
parameters (e.g., the "influenc? coefficients"). In this
Program, there can mor? information available than the
minimum necessary (the problem would be overdetermined), so
the fitting would not be exact for all data. Th? program
takes advantage of excess information by using a weighted
least-squares criterion that plac2s emphasis on those
standards with th2 smallest assumed errors in intensities,
and on those standards whose intensities ar? clos2st to the
intensities measured from the unknown. The nonlinear
“normal equations" ar? solved by the standard Newton method.

Fourth, one has a method for finding the composition at
which intensities calculated from the regr?ssion mode2l agr2?2
with the intensities measured. In the general case, excess
information can b2 handled to advantage. This program
calculates the composition that minimizes the root-m ean—
Squar? value of weighted disagreement in intensiti2s: the
difference between measured and calculated intensities is
divided by the assumed random difference. When the amount
of a component is fixed, the corresponding normal equation
is replaced by that constraints when the total amount is
fixed, the method of Lagrange is used} solution of the »
nonlinear equations is by Newton’s method. The statistic
chi equals the minimum r.ms. value mentioned above,
multiplied by the square root of the number of lin2s, and
divided by the number of degrees of freedom. The number of
degrees of freedom equals th? number of lines, minus the
number of compm ents, plus the number of constraints (total
amount fixed, amount of a component fixed, 2tc.).

40


At the beginning of a run, and after a RESET, the default
values of counting-time for signal plus background, counts
for background, time for background, and dead-time are

1, 0, 1, and 0. Then, if one inputs only one datum after
each line-number (as in the example on page 4), that datum
will be int2rpreted as net counts per s2cond,.

The user is cautioned that the program makes only the
simplest kinds of dead-time and background corrections, so
for complex situations (8.9., when the dead-time is large,
or when energy-dispersive techniques are used) it might be
best to mak? more specialized dead-time and background
corrections before inputting data to this program.

If a line-number is the only datum input, th? program will
assume that the line was not measured for that sample.

A value of zero for total-counts time causes the program to
assume that the "total counts" is actually in units of
“relative x-ray intensity" (RXI, the sam? units output by
the PREDICT command — see pag? 13).

Ordinarily, the user will want the program to consider all
standards when calculating th2 composition of an unknown,
Then, theoretical calculations will automatically be
adjusted to match the standards most similar to the unknown
(see Appendix C). However, it is sometimes desirable to
observe the results of using s2lect2d standards.

NORMALIZE is an optional k2yword that lets the user name a
specific standard to b2 used as the only reference for som?
lin?, rather than having the program us? all standards that
have been input. One standard is nam2d for 2ach linet

NORMALI ZE
| CRSTD
2 FESTD
3 NISTD

Pe aes

If a single multicomponent standard is the "normalizing"
standard for all lines, then that standard would be named
for each of the lines under NORMALIZE.

If, for any lin, all standards are to be used for
normalization, then the word ALL would be input in place of
the name of a specific standard. If all standards are to be
used for all lines (the d2fault treatment) then a special
one-card command may b? used:

* NORMALIZE ALL


G. R. Lachance,
“A Simple Method of correcting measured X-ray intensities
into mass compositions”
Geological Survey of Canada paper 64-50 (1964)

(empirical form for int2nsities vs. concentrations)

JwA. Bearden,
"X-ray Wavelengths"
U.S. Atomic Energy Commission Report NY0-10586 (1964)
(wavelengths of absorption edges and emission lines)

P, Duncumb and P.K. Shields,
The Electron Microprobe
T.D. McKinley, K.F.J. Heinrich, and D.B. Wittry, 2ds.
Wiley, New York, pp 284-295 (1966)
(formula for “Lenard coefficient" in Philibert’s equation)

J.A. Bearden,
“X-ray Wavel 2ngths"
Reviews of Modern Physics, 39, p 78 (1967)
(wavelengths of absorption edges and emission lines)

J.A. Bearden and A.F. Burr,
"Reevaluation of X-ray Atomic Energy Levels"
Reviews of Modern Physics, 39, p 125 (1967)
(wavelengths of absorption edges and 2mission lings)

U.S. Department of Commerce, National Bureau of Standards
"X-ray Wavelengths and X-ray Atomic En2ray Levels"
(republication of th? two pr2ceding articles)

NSRDS-NBS 14 (1967)

J.V. Gilfrich and L.S. Birks,
"Spectral Distributions of X-kay Tubes for Quantitativ:
X-Ray Fluor2scence Analysis"
Analytical Ch2mistry, 40, p 1077 (1968)
(measur2ment of x-ray-tube spectra)

J.W. Criss and L.S. Birks,
“Calculation Methods for Fluorescent X-ray Spectrometry
—— Empirical Coeffici2nts vs. Fundamental Parameters"
Analytical Chemistry, 40, p 1080 (1968)
(primary and secondary contributions from thick,
homogeneous sampl2s, and th2 use of tabulated X-ray-
tub? spectra) Note: in NRLXRF, integration over the
incident spectrum uses a composite of trap?zoidal and
Simpsons rules, rather than a histogram tr2atment; the
“iteration method" described in the 1968 Paper is not used
in .the current program (see Appendix C of this manual).

29


MAC, keyword (mass absorption coefficient) 21, 33, 54, 55
mass p8r unit area of sample (g per sq cm) 23, 25, 27, 35
mass proportions — see DEFINE
mass-thickness (g per sq cm), filter 7
sample 23, 25
maximum number of components, etc. 37
MAI (line) 4, 6, 34
measurement conditions (see “experimental param et ers")
memory requirements 48, 53-55
Milliamp 43
minicomputers 1, 53-55
model for regression 22, 38-40
modification of program 53-55
monochromatic incident radiation 6
monolayer of particles 26-27
mul ticomponent standards 8, 11, 14
multi-el 2mant components 12, 20, 25, 32, 45
MULTIPLIERS (keyword) 21, 33, 36, 54

names, rules for 5

NO (keyword modifier) 15, 18-19, 33
non~interfering particles 26-27

nonlinear regression 22, 38-40

normal equations 40

NORMALIZE (keyword) Il, 14, 33, 54

Normalizing standards Il, 14, 33

NRLEMP = 53-55

NRLSIM 53-55

numbers, rules for input (see “free-field input")

order of input 3, 32-36

Optional commands 5-6, 11, 12-14, 18-22
Optional data -- see "default

optional features, elimination 55
OUTPUT (keyword) 18, 33

oxides 12, 45

Parameters, 2mpirical (see “influence coefficients")
Parameters, fundamental (see “fundamental paramet 2rs")
PARROT (keyword) 19, 33

particles 14, 24-27

PARTICULATE (sample kind) 23, 24

PCT (keyword) 18, 20, 33

PCT DIFF 15

PH/SR/SR 23-24

PH/SR/SR/G 23-24

photon energy 6, 21, 32, 34

photon wav2length 6, 21, 33, 34, 43-44, 46~47
physical theory 38-42

6l


et al. A generalization of the regression model of Lachance is used for
efficient iteration and to facilitate the calculation of precision in com-
position (as affected by precision in measured intensities).

The program runs in less than 60K bytes on a Digital Equipment Corporation
PDP-10 computer, in either interactive or batch mode. The source language
is a fairly standard FORTRAN IV, to facilitate conversion to other computers.
This document contains user instructions, implementation instructions, and
suggestions for reducing core requirements.

A magnetic tape containing the source program and three data files may be
purchased from the Computer Software Management and Information Center
(COSMIC), Suite 112, Barrow Hall, Athens, Georgia, 30602, (404) 542-3265.
The COSMIC program number is DOD-00065


weight per cent, of components (se? “amount")

weight proportions, in DEFINE 12, 20, 25, 27, 32, 55
weighted least squares 38-40, 42

window thickness T, 21, 34-35, 41

words, rul2s for input 3-6, 19, 32, 34

x-ray tub? spectra 4, 7, 21, 41, 43-44

XI (x-ray intensity) 15

XI/XIO 23, 27

XRDATC 7, 12, 20, 25, 35,- 36, 45, 49-52, 55
XRDATP 46, 49-51

XRDATS T, 35, 43-44, 49-51, 55

XRDAT2, XRDAT3, XRDAT4 18-19, 36, 49-51
XROUT 18-20, 36, 50

? (for unknown amount) 9, 13, 25, 36
$ (end-of-record mark) 34

64


slits 24

slurries 24

solid angles 24, 42, 43

sourc? program 48-55

spectrum analysis 10

spl, sp2 6-7, 21, 32-34

sp3, sp4 7, 21, 32-34

sp5, sp6 7, 32-34

standards 2-6, 8-11, 13-16, 19-20, 22-24, 27, 38-42, 53
statistics 15, 38-40, 42

STEP (keyword) 21, 33, 54

steradian 24, 43

subprograms 50-55

subshell fluor2scenc? yi2lds 41

SUM (keyword) 9, 13, 16, 33, 36, 54
synonyms for components 12, 25

tabulated spectrum T, 43-44
take-off angl2s, sample 4-6, 14, 27, 343 tube 6-7, 21, 35
TEMP (special sp2ctrum name) 7, 34
terminal input/output 18-19, 36
termination of job 3, 18, 32
test data 4, 27
theoretical treatments 1, 26, 38-41
theoretical RXI~s Il, 13, 14, 18, 20, 22, 23, 27, 36, 42
THEORETICAL (k2yword) 14, 22, 24, 26, 33, 54
thickness, correction method 41
filter 7
sample 23, 25
tube window 7, 21, 34-35, 41
thin samples 23, 34
time —- s22 "cost of runs" or "counting time!
timesharing 3-4, 19, 48-51
transition probabilities 4)
TUBE (keyword) 4, 7, 21, 33, 35
tube spectra 4, 7, 21, 41, 43-44

uncértainti 3s 15-17, 26, 38-42
units of measur?

see specific quantities, such as "angles", "mass"
unknown sample 5-6, 8-11, 14, 20, 24-25, 36, 38-40, 42, 53

vacancy distribution 41
variable take-off angle 4
voids 25-26, 35

WT (for weight proportions in DEFINE) 12, 32, 35

warning messages 14, 18

wavelength, incident photons 6, 21, 33, 34, 43-44
lines and edges 41, 43-44, 46-47

63


COEFFICIENTS is a simple command that causes the program to
output the current values of the parameters used in the
regression model (discussed in Appendix C). These values
pertain to a limited composition rang2 in the vicinity of
the last sampl? analyz2d, and might be useful in some other
program that uses a more traditional empirical approach.

The table of parameters is output in the form

FOR EACH LINE, THE EMPIRICAL EXPRESSION,
AS AN EQUATION LINEAR IN THE AMOUNTS (WS), IS

(GI-BI*XI)*W1 +(G2-B2*XI)*W2 +... = BORXI

COMPONENTS?

FECL3 FE203 NACL
CL KA
GS: 0.65567E+00 0.00000E+00 0.60653E+00
B?Ss 0.00000E+00 -0.12678E+00 0.66474E+00
BO= 0. 14983E+01
FE KA
GS: 0.34433E+00 0.69945E+00 0.00000E+00
BYSt 0.12138E+01 0.00000E+00. 0.10373E+01

BO= 0. 77612E+00

BFIXED is the default option affecting the form of the
regression model (see Appendix C and th? 2xampl2 under
COEFFICIENTS above). For 2ach linea, the "Bp" Parameter is set
to zero for th? component with the largest "G" value. In
some cas.2s the mode] has a form comparable to that used by
Lachance? and others — @.ge, when all components are
elements and the intensities are RXI“s.

BFREE permits all "B" parameters in th2 regression model to
be free, thus allowing more flexibility in fitting standards.
One should not us? BFREE when the sum of amounts is
essentially the same for all standards (or for THEORETICAL),
or 2lse numerical (roundoff) 2rrors might result.

22


ADDITIONAL FEATURES

4. Samples and Compositions

The simple analysis exampl? given earlier (page 4) used only
one standard reference material. In general, howsv2r, one
should input data for as many standards as ar? well-known
and similar to the unknown in composition.

Each line defined under LINES must be measured from at least
one standard — a pure element May be used if good multi-
component standards are not available. Beyond this minimum
requirement, the more standards used, the more accurate the
analysis in general. The program automatically considers
all standards, making its calculations agree best with the
standards that are most like the unknown (s¢e2 Appendix C).

The standards may be quite different from the unknown, as
is sometimes necessary. For example, suppose one wished to
analyze.a phos phorus~containing steel, and did not have a
standard alloy that contained phosphorus. In such a case
the analyst could simply us® any convenient compound of
phosphorus (@.g., a glassy sample of. ammonium dihydrogen
phosphat?, "ADP"), and define its composition accordingly
(by weight per cent):

* COMPOSITION ADP
* P 26.93

* N 12.18

* H 5.25

* 0 55.64

*

The analyst could then input an INTENSITIES ADP group that
contained only the measur 2d intensity for P KA. The program
would automatically take account of all elements in this
standard.. It would not matter that no x-ray lines of
nitrogen, hydrogen,. or oxyg2n wer? measured, and that these
elements ar? absent from the unknown sample to be analyzed.
However, th? analyst would need to specify just which
elements are to be considered in the unknown, 2.9.

COMPOSITION STEEL
SI ?

*

*
* P ?
*S ?
* CR
* MN
* FE
* NI
*

WD WWD


Choice of calculation method for analysis

There are three basic approaches available for analysis.
The selection is made by issuing one of the three simple
commands EMPIRICAL, THEORETICAL, or FULL.. Whenever ANALYZE
is issued, calculations will depend on the current setting
of this.option. A RESET command will re-establish the
default option, FULL.

FULL analysis calculations use all standards to adjust the
theoretical intensities (see Appendix C). It is advisable,
but not required, that some of the standards be? similar to
the unknown not only in composition, but also with regard to
sample thickness and homogeneity. When standards differ in
these physical characteristics, the appropriate? parameters
need to be input (see pages 23-27).

EMPIRICAL analyses ignore physical theory, and us? a
regression method that considers. all standards, *mphasizing
those standards most like the unknown (see Appendix C).

All intensities must be in the same units (i.e., all RXI’s
or all raw.intensities). Since the regr2ssion method does
not include parameters for sample thickness, particle sizes,
etc., thes? properties should be the same for all samples.
It is not ncessary to include the line abbreviation, angles,
etc. after the element und2r LINES, sinc? those parameters
would not be us2d by the program (likewise, CONDITIONS is
not needed). If not enough different standards hav? been
input, then the program will output warning m?ssages and
automatically simplify the regression model. For the full
regression, 2ach line must hav? been measured in at least as
many standards as there are components in the unknown; also,
for each combination of compon 2nt and m2asured line, there
must be at least on2 standard for which both the component
concentration and measured intensity are nonz2ro. When only
these minimum criteria are met, th? standards might still be
insufficient (e.g., if two of th? standards have almost the
sam? composition, but random errors prevent good corr?lation
with intensities) under such circumstanc2s, numerical
errors can result. In general, the more standards, the
better, except for computing costs. ‘EMPIRICAL runs cost
only about half as much as those using the FULL option.

THEORETICAL analyses use predictions from physical theory
(made automatically), but ignore all standards except those
Named under NORMALIZE (which command must have been used,
but without th? word ALL). Thus, for each line, only one
referenc2 material is used to adjust the physical theory.
Under this option, the program will run somewhat faster than
when FULL calculations are mad?, and the statistical
estimates (see pages 15-17) are more approximate.

14


5. X-ray Intensities

Previous examples showed the line intensities input as
net counts per second, after correction for dead time,
background, and counting times. However, the program can
make these corrections. if input is in the general form

* INTENSITIES TESTI

1 265900 20 340 20 2.2
-2 146271 100 28 10 2.2
3.124266 20 281 20 2.2

Ot

After the line-number, one puts the total number of counts
(signal+ background), then the corresponding counting time
(in seconds), then the total counts for background, then its
counting time, and finally the detection-system dead-time
(in microseconds). The data for background might be
obtained by spectrum analysis, by measurement of a "blank#
sample with similar scattering properties, or by other means.
If the corrections for background etc. lead to negativ? net
counts per second, the value will be set to zero.

It is. not necessary to input intensity data for every line
in a sample, although one usually does so for unknowns.

For standards, one could input data just for the lines that
wer? measured, or th? lines that are to be considered,

It is not even necessary to input all six data for each lin2
treated, since the program can us? previously input data as
defaults. For each lin2-number, the program will use as
default values the last values input for total-counts time,
counts for background, etc. (i.e., there is no default for
total counts). Once data have been input for a particular
line, then subsequent entries for that line do not need to
include data beyond the last item that changes. For example,
the above INTENSITIES group could b2 followed by the group

* INTENSITIES TEST2
* 1 457632 10

* 2 87492

* 3 105738 20 263

*

which would b2? th? sam? as the complete input

* INTENSITIES TEST2

1 457632 10 340 20 2.2
2 87492 100 28 10 2.2
3 105738 20 263 20 2.2

OE


NON-IDEAL SAMPLES
10. Finite Thickness

At any place where one may input the name of a sample, the
sample name may b2 followed by one of three words used to
define the sample kind: HOMOGENEOUS, PARTICULATE, or
SEPARATE. Each of these words May b2 abbreviated by as few
as the first three letters: HOM, PAR, or SEP. The examples
in this section will b?2 for homogeneous samples$ the other
two kinds are discussed in Sections 11 and 12.

Following the sampl2 kind, the user may specify the
mass—thickness of the sample, in grams p2r squar2
centimeter. For example,

* PREDICT SAMPI HOMOG .02

The sample characteristics HOMOG .02 will be saved in the
program, and thus will be available later whenever SAMP! is
used, unl2ss the user inputs different data aftzr the name
SAMP!. Th? initial default data (2.g., after a RESET) are
HOMOG 100. The default values (initial or current) will be
used automatically for all samples not yet named. Und2r the
LONG option, the output resulting from th? above command
might look like

LINE RXI RXI/ZC XI/XI0 PH/SR/SR_ —- PH/SR/SR/G

1 CR KA 0.168442 1.403682 0.476909 0.2880E-03 0.1200E+00
2 FE KA 0.472483 0.656227 0.255043 0.1475E-02 0.1025E+00
3 NI KA 0.037608 0.235049 0.099583 0.1913E-03 0.5979E-01

RXI is the relative x-ray intensity (relative toa
pur®—slement standard of effectively infinit2 thickness).

RXI/C is RXI, divided by the weight fraction of the
fluorescing element in the sampl2.

XI/XI0 is the fluorescence intensity, r2lativ2 to that from
a sample with the same total mass, but in th2 form of an
ultra-thin foil. Thus. XI/XIO expresses the departure from
an ideally thin sampl2. If the mass-thickness of SAMP] had
been 0.0001, then. the values under XI/XIO would hav? been
very close to unity. For v2ry thick samples (the initial
default assumption), th? values under XI/XIO would have
b22n z2ros.

23


described in Section 3 (page 6). If angles etc. ar2 omitt2d
for some lines (as for ZN KA above), the program will use
the last set of values input (@.9., those for CU KA). If
angles etc. are not input for any lines, the program will
-use default analysis conditions (they may be inappropriate
in a strict sense, but still can permit accurat2 analysis if
some of the measured.standards are similar to the unknown).
One can add or change the data for selected lines by
inputting another LINES group with data for thos? lines,

CONDITIONS is a keyword (not. illustrated above) that can be
used to specify measurement conditions that apply to all
lines. For example, instead of including the angl2s etc.
under LINES above, one could have used the separate? input

* CONDITIONS 57 40 W 50

COMPOSITION introduces the composition of a sampl2 with som2
arbitrary name (@.ge, SRM1102). Th? nam2 should consist of
only letters and digits, with no imbedded blanks; only the
first 8 charact2rs ar? used. The data group includes th2
nam? and weight per cent of each compon2nt. In th? example,
the components are elements, but if compounds are to be
treated as the separat2 constituents, they may be listed as
well (s.e2 the DEFINE keyword, discussed in Section 6,

page? 12). Each use of a COMPOSITION group redefines the
entire composition of the named sample,

INTENSITIES is followed by an arbitrary sample name (such
as SRM1102 or BRASS). This k2yword introduces the measured
intensities, which may be in the form of net counting rat:
the number of counts per second, after corrections for
counting times, dead time, and background. The program can
make these corrections if the appropriate information is
input (see Section 5 on Measured Intensities, page 10).

A single group of INTENSITIES data May contain intensities
for all measured lines, as illustrated, or it May contain
intensities for only som2 of the lines’ — subsequent
INTENSITIES groups May b2 us2d to add or change intensity
values. Note that each intensity must be labled with a
line number that was defined by LINES.

ANALYZE causes the program to calculate and output the
composition of the sample named. The ®2xample above shows
answers output in th? short form, which is the default
situation. The numb2r of digits printed is no indication of
accuracy. Estimates of consistency and precision are
produced if the user has already issued the simpl2 command
LONG, which is discussed in Section 7 (page 15).


APPENDIX H. Program Archit2cture

List of Subprograms

The program consists of a main program plus 65 subprograms,
including 48 subroutines and 17 function subprograms.
Below is a list of subprogram names. Function-sub program
names end with the letter "F"; subroutin2 names do not.

RESET NEXTQ ERROR KUF COND
SAMP DUMPS SNORM MEAS XSAMP
YNORM COMP SPEC MAC DEFIN
LINE JZYS QUAN UNK XTOC
SPIN PREP JLDF AF WLF
WEF FLF YXF POINT SORT
SPECW ITER DOTF - NORM SETA1
EXP2F ADJB GAMBS XSF SSTDS
COEFS DISTF SIM YBAR SIM2
ADJBI SIMP EXPIF SIM4 SIMR
SIM6 DEFD ATWTF ZABD FHETF
EMACF CMACF TUBE FCHI F IN
IN2 SOLV SOLV2 SOLV3 FILIO

Input/Output Device Assignments

In the July 1977 version of the program (for DEC Fortran-10
timesharing), input is from the terminal and six disk files,
and output is to the terminal and one disk file. The
following table gives the I/0 device number used in READ and
WRITE statements, the kind of I/0 operation, the kind of
device, the fil? name (if disk), and the sort of information
transferred. Unit 2 is not used in the original version —
it does not apply unless on2 must modify the program to
avoid ENCODE and DECODE stat2ments, as described below.

Unit Purpose Devic2, File Information Transf2rr ed

1 READ disk XRDATS. incident spectra
#2  READ/WRITE disk XRSCR. input scratch file (optional)
3 READ disk XRDATC. compounds definitions

4 READ disk XRDATP. 2l2ments’ physical parameters
5 READ terminal (TTY) user-supplied input

a WRITE terminal (TTY) program output

7 READ disk XRDAT2. alternate us2r-suppli ed input
8 WRITE disk XROUT. alt2rnat? program output

9 READ disk XRDAT3. alternate user-supplied input
10 READ disk XRDAT4. alternate user-supplied input

# not used unless ENCODE and DECODE ar? disabled (s2e below).

50


5820! W24 K)= W2C K- 1)+ DELW

58203 WIC Ky= WTK
58205 WLAST#= W2( K)
3207 . IF. ( KSKP.NE. 0.) GO TO 22
3209 NW2T= NW2T+ |
58211 .GO TO 17
58213 18 CONTINUE
58215 . WTK=( WTEST- WLAST)/ 2.
. 58217 - WTC K= WTC K)+ WIK
58221 K= K+ 1
58231 W2( K)= WIEST
58241 WT(¢ K)= WIK
. 58251 22 IF ( IEDG.GE. NEDG) GO TO 5
58261 K= Kt |
. 58271 W2( K)= WEDG( IEDG)+ 0.0001
58281 WTC K)= 2.0% 0.0001
58291 WLAST= .W2. 1)
. 58293 5 CONTINUE
58294 NWERR= K+ NWERR
58295 IF ( K.NE. NWERR) WRITE( KW, 60!) K, NWERR
58301 .601 FORMAT( 2X, 11HWARNs USING, 1353H OF, I4,20H PTS IN LAMBDA GRID.)
70021 . COMMON/SPEC2/ .NW2, W2( 80), SP2( 300), JSP2( 30), RMESH
74021 COMMON/SPEC2/ NW2, .W2.( 80), SP2( 300), JSP2( 30), RMESH
76021 COMMON/SPEC2/ NW2, W2( 80), SP2¢ 300), JSP2(¢ 30), RMESH
. 77021 COMMON/SPEC2/ NW2, W2( 80), SP2(. 300), JSP2( 30), RMESH
78021 _ COMMON/SPEC2/ NW2, W2( 80), SP2( 300),.JSP2( 30), RMESH


LIST caus?s the program to list the data it has for a
sample, in the form necessary for input from an auxiliary
fil? (including sequence numbers). Som2 of the parameters
output are used only for samples that are not homogeneous
and thick (see Sections 10-12: Pages 23-27). Example output
for LIST SAMP! is

1020 COMPOSITION SAMP 1 HOMOG 100.0000 0.0000 0.00 1.0000
Cc te)

1030 12.0000

1040 FE 72.0000 O

1050 =NI 16.0000 oO

1060

1070 INTENSITIES SAMPI HOMOG 100.0000 0.0000 0.00 1.0000
1080 i 0.17000E+00 0

1090 2 0.48000E+00 0
1100 3. 0.38000E-01 oO
1110

An unknown amount of a component is listed as -1. The digit
after an intensity is 0 if RXI%s are output; otherwise, it
is 1, indicating neat intensity in counts per second. Under
the LONG option, an ERRORS group (page 15) is also output.

DUMP is a simple command that is useful for saving
information necessary to s2t up NRLXRF (or another program)
for EMPIRICAL analysis. By using OUTPUT 2 and DUMP, the
analyst can create a data file that is readabl2 by NRLXRF.
The output will identify the LINES by element, and will
specify whether the PCT or NO PCT option is used:

2020 EMPIRICAL

2030

2040 LINES
2050 1 CR
2060 2 FE
2070 3 NI
2080

2090 PCT

Next, the program will automatically LIST all samples that
ar? standards — a sample is a standard if its complete
composition has been specified. The output will include
intensities for all standards that were input and all that
were SIMULATEd (page 13), since the last RESET. For each
standard, the output has the same form as LIST, except that
no information follows the sampl? nam@ on the COMPOSITION or
INTENSITIES lin?, and particl? sizes are not included after
the amounts. The LONG option will cause ERRORS groups to b?2
output, If any multielement components ar? not defined in
the file XRDATC, the analyst will need to add the necessary
DEFINE groups (pag2 12) before making later runs based on
the output from DUMP.

20


GENERAL INDEX

A (angstroms, photon wavelength units) 6
abbreviations, keywords 3, 34

lines 4, 14, 34

other 23-24, 34-35
absolut? intensities 13, 23-27
absorber 7, 35, 41
absorption coefficients 1, 21, 41-42, 46
accuracy 2, 5, 8, 15-16, 26, 38, 42 (s22 "precision")
addition methods 9
ADJUSTED 17 .
adjustment of composition 12-13, 17, 39
adjustment of theory 2, II, 13-14, 17, 39, 41-42
air-path correction 7, 24, 41, 45
ALL (used with keyword NORMALIZE) 11, 14
amount 4, 9, 13, 16-18, 20-22, 26-27, 32, 36, 39-40
analysis methods 1-2, 9, 14, 15, 22, 24-27, 38-42
ANALYZE (keyword) 4-6, 12-15, 21, 32, 34, 53-54
angl2s (degrees), incidence and take-off 4-6, 14, 27, 34
angl2s (degrees), take-off from tube anode 6-7, 21, 35
angstrom (nanometer) 6, 7, 24, 34, 37, 43-44, 46
angl 32, 34
ang2 32, 34
anode? 7, 21, 34-35, 41
area of sample (sq cm) 25, 32, 35
array sizes 37, 48, 53
ASSUMED 15-17
assumed 2rrors in intensitias 15-17, 21, 36, 40, 42
AT (for atomic proportions in DEFINE) 12, 32, 35, 46
atomic proportions, in DEFINE 12, 32, 35, 46 :
Auger transitions 41, 46
auxiliary files for input/output 18-20, 33, 36, 48-51, 55

B parameters (betas) 22
background m2asur 2m ants 5
batch proc?ssing 4, 18, 1
BFIXED (keyword) 22, 33
BFREE (k2yword) 22, 33
bias 17

binder 9

blank sample 10

bulk particulate samples 24

» 10-11, 26, 36
9, 51

calculation method, choic2 14

description 1-2, 9, 14, 15, 22, 24-27, 38-42
calibration, fitting standards 9, 14, 15, 22, 24-27, 38-42
card image 3, 7, Il, 19, 32, 34, 44-46, 49, 51-52
card numbers 19, 44-46, 40, 51-52

57


element symbol 4, 6-7, 12-14, 20, 32, 34-36, 45
elemental comvosition 5, 7-8, 12, 32, 34-36, 45
ELEMENTS (keyword) 12, 33

EMPIRICAL (keyword) 14, 18, 20, 22, 24, 26, 33, 39-40
empirical coefficients (se2 "influence coefficients")
END (datum to mark end of file) 43-45

end of run (QUIT) 3, 32

energy, incident photons 6, 21, 32, 34

environmental samples 24-27

EQUALS (in sp2cial form of DEFINE) 12, 25, 32

?rror messages 14, 18

ERRORS (keyword) 15, 17, 20, 33

errors 14, 15-17, 18, 22, 26, 38-42

ESTIMATE number 17, 21

2xampl2 runs 4, 27

experimental parameters 4-7, 10-11, 14, 20, 21, 27, 32, 40

FATAL (keyword) 18, 33

files, input/output 18-20, 33, 36, 46-51, 55

filter (substrate) 26

filtered incident spectra 7, 32, 34-35, 41

fitting stanaards 9, 14, 15, 22, 24-27, 38-42

fixed amounts 9, 13, 16-17, 36, 39-40, 45

FIXED 13

fluorescence, indirect 1, 37, 41

fluorescence yields 41, 42, 46

fluor2sc2r, as radiation source 6

flux 9, 12

foil 23

format for inputting data 3-7, 20, 21, 32-36, 43-47
free-field input 3, 32, 43-45, 51-52

FULL (keyword) 14, 24, 26, 33, 39, 40, 53-54
fundamental parameters 1, 2, 14, 41-42, 46-47, 50, 53

G param2te2rs (gammas) 22

given amounts (see "fixed amounts")

glass 8, 12

grams per squar? c2ntim2t2r 23, 25, 27, 35
granular sampl2s 24-27

group of data (see "data groups")

HELP (x 2yworu) 3, 32

heterogeneity 1, 24-27, 41

homogenous samples 1, 4, 23

HOMOGENEOUS (sampl2 kind) 20, 23, 25-26, 35, 41-42
hypothetical standards 13, 38-39, 41-42

59


imoring particle sizes,.stc. 14, 20, 26
ignoring standards 11, 14

implementation of program 48, 49
imprecision 15-17, 39

incidence angl2s 4, 6-7, 14, 27, 32, 34
incident radiation 4, 6, 21, 32-35, 37, 41, 43-44
independent analysis 9

infinite thickness 4, 11, 23-24, 25, 41
infinitesimal particles 25-27
infinitesimal thickness 23-27

influence coefficients 2, 14, 22, 40
initial values (see "default values")
INPUT (keyword) 18-20, 33, 36
input/output options 18-20, 33, 36
input/output devices 50

input rules for numeric and non-numeric data 3-6, 19, 32
input styl2 3, 32

installation of the program 48-49
INTENSITIES (keyword) 4-5, 8-11, 20, 32
interactive runs 3-4, 19, 48-51

internal standards 9

invers? regr2ssion 38-40

isotope excitation 6

iteration 21, 38-39

job set-up 3-5, 18-19, 32-36, 48-49
job termination 3, 18, 32
jump ratio 46-47

KA (line) 4, 6, 34

KB (line) 4, 6, 34

KEV (photon energy units) 6, 21, 32, 34
keywords 3-6, 32-33

kind of sampl? 1, 23-27, 35

LA] (line) 4, 6, 34

labeling data 19, 34, 43-45

labels for sampl2s (sampl2 names) 3, 4-5, 8-9
LBI (line) 4, 6, 34

LB2 (line) 4, 6, 34

least squar?2s 38-40, 42

limits on number >of data 37, 53

line abbreviations 4, 6, 34

line number 4-5, 9-11, 20, 21, 35
line-numbered files (s22 "card numbers")
line radiation incident 6-7, 34, 43-44
LINES (keyword) 4-5, 6, 11, 20, 22, 32, 37
lines treated internally 37

LIST (keyword) 9, 20, 33

list-directed input (see "free-field input")
local vs. global fitting 38-42

LONG (keyword) 15, 18, 20, 23, 33

60


qhe next section of output under the LONG option has the
orm

ESTIMATE 3: COMPOSITION CONVERGED.

COMPONENT AMOUNT IMPREC. BIAS ADJUSTED
FE 69.3952 +/- 0.21 - 0.71 68.7
NI 6.9721 +/- 0.067 - 0.0099 6.96
CR 21.5110 +/- 0.21 - 0.088 21.4
MN 2.1217 +/- 0.021 - 0.0009 2.12
(TOTAL) 100.0000 (FIXED) - 0.81 99.2

IMPREC IS IMPRECISION (STD DEV) DUE TO ASSUMED RANDOM ERRORS.
BIAS IS A LINEAR ADJUSTMENT, IGNORING THE OTHER COMPONENTS,

The estimate number and convergenc? crit?ria are described
under STEP on pag? 21. As indicated above, the program
estimat2s propagat2a 2rror and expresses it as standard

- deviation in calculated amount, Thes2? 2stimat2s ar? based
on the assumed random errors in relative intensities Cinput
under ERRORS, or seat by default to 1 per cent relative).

The program estimates "bias" values, which are measures of
inconsistency in composition — in contrast to the numbers
under PCT DIFF, which apply to intensities. Each "bias" is
a first-order adjustment mad2 to each component separately,
in an attempt to remove the disagreement observed between
measured and calculated intensiti2s. Note that this bias is
useful mainly in identifying components for which the
inconsistency is greatest. The amounts listed und2r "AMOUNT"
are the program’s best estimates for the situation at hand,
considering all components and their mutual effects, plus
any constraints on the amounts of individual components, or
on the total amount. If the value under BIAS is gr2ater
than. the value under IMPRECision (as for FE in the example),
then the bias value should be considered in assessing errors
in composition. The amounts listed under ADJUSTED have b2en
adjusted for the bias; however, they would normally not be
better than those under AMOUNT, unless the analyst wished to
relax some constraints (in which case the probl 2m should be
re-run without the constraints).

The values under IMPREC and BIAS are given to two
“significant digits" (to a maximum of four digits after the
decimal point), but perhaps only the first nonzero digit is
dependable. The values under ADJUSTED are given to the
number of digits that includ2s the first nonzero digit of
the value under IMPREC,


NAVAL RESEARCH LABORATORY

WASHINGTON, D.C. 20375 IN REPLY REFER To: 6680JWC

JULY 1978 UPDATE.TO NRLXRF, COSMIC PROGRAM DOD-00065

The following groups of modifications are given as lines to ba changed
-or added to the July 1977 version. The first 5 digits shown refer to
the_card-sequence numbers} originally aopsaring in.colums 73-77.

The -following.changes should be made at all installations, to correct
known. errors, and to avojd possible execution. errors, on some systems.

11483 1 / 2X, 24H UPDATE NRL JWC° JULY 78,’ ~ -
15189 DATA HTEST/ 3HRES/

1B1O1C XXX

2049.1 182 . FORMAT(. A3)

28998 KCONT= 0

29003 IF ¢ SP1( IW).EQ. 0.) KCONT= 1

29005 CON= EXP2F( -23., - TFN* CMACK(. HFILT, W1¢ IW), 1, KMAC))
29007 - IF (.KCONT.NE. Q) SPI IW)= SPI( IW)* CON
29009 - IF ( KCONT.NE. Q) GO TO 10

29011 IF ( CON.NE. 0.) SP1( IW)= SP1( IW)* CON
29013 IF ( CON.EQ. 0.) SPI( IW)=— SPI¢ IW)
29021 10 CONTINUE

48153 IF ( NW2.LT. 1) GO TO 10

48203 10 CONTINUE

56055 CALL SORT( WEDG, NEDG+ 0, NEDG, 1.)

36057 CALL SORT( WLIN, NLIN+ 0, NLIN, 1)

“6156 IF ( SPI(.IW)..LT. 0.) GO TO 1

i313 -DO 16 ISP= 1, NSP

28315 16 JSP2( ISP)=( -ISP— 1:)* NW2

58401C tXXX

58476 IF ( SPIC IW)..LT. 0.) GO TO 1

58551 14 IF ( NEDG.LE. 1) GO TO 15

59233 DO 62 IX= 1, NX

59235 DXC. IX)= 0.

59237 62 BX( IX)= 0.

68693 IF ( ABSG VCC IC)= VS( IC)).LE. 0.0001* VS( IC)) GO To 4
69081 IF.( KPREP.EQ. 0) GO TO 7

69121 7 IF ( KIND.LT. 3) GO TO 8
~ 70181 ROC( IY)= 0.

70203 IF ( JWL( IL).LT. 1) GO TO 12

74143 IF ¢ JWL( IL).LE. 0) GO TO 12

74591 12 IF ( PURE( IY).LE. 0.) PURE( IY)= 1%E-34
76183 IF ( JWLC IL).LT. 1) GO TO 12

77423 TF ( JWL( IL).LT. 1) GO TO 15

77251 15 IF ( ROMZ( IY).LE. 0.) ROMZ( IY)= 1.E=-34
78536 IF ( JWL( IL).LT. 1) GO TO 12

80721 703 FORMAT( Al, 15X, E16.0)

86463 IF ( WAVE.LE. 0.) GO TO 19

88963 SPL= CONI* SPL* FCHIF( VOLT, NZI, WLL, RADI, RAD2)
88965 - SPL= SPL* EXP2F( -23., - EMACF( 4, WLL, 1, KMAC)* BET) .
88967 IF ( SPL.LE. 0...) GO TO 4

8899 1C tXXX

2001 SP1( NW1)= SPL

A141 DO 8 IWC= 2, NWC2

91621. 9007 IF ( KR.NE. KUF( 5)) Il= 7

93121 NR= -1 me
93171 NR= ~1

98199 REWIND NUNIT boa \


FOREWORD

This reference manual is designed mainly for the user,
rather than the programmer, and so it describes the input
and output features. of the program, rather than its internal
workings, except for brief explanations to help analysts use
the program efficiently. Programmer-ori ented documentation
is.deferred to the Appendices.

If the reader has never used a program directly, any user of
the appropriate computer can provide the basic concepts for
starting a run and inputting data. This program can b?2 run
either as a batch job or interactively; the form of input is
the same for both modes,

Both: the program and this manual were designed to help the
user get started with a minimum of instruction. It takes
just five pages (Sections 1-3) to describe, with an example,
how to analyze thick, homogeneous samples. It is.hoped that
the rest of the manual would need to be consulted only as
more versatility is desired. Note that there is an Index.

An annotated bibliography is included for those interest2d
in further details of experimental method and th2oretical
technique, However, many of the theoretical treatmants and
statistical methods used in the Program are based on
unpublished research by the author.

Appendix A is designed as a quick refer2nce for the user who
has already run problems successfully, but needs to look up
some of the features used less frequently. Appendix B lists
the program-imposed limits on th? "size" of problem that can
be run. Appendix C sketches the calculation method usd to
combine physical theory and standards for analysis.

Appendices D, E, and F would be needed only if the analyst
wanted to verify, add, or chang? data in one of the
fundamental-paramet2rs data files.

Appendix G contains a brief gen2ral document .tion, including
implementation instructions for a Digital Equipment Corp.
PDP-10 computer. Appendices H and I might be useful to a
programmer who needed to reduce the cor2 requirements.

Frequently, a data-analysis program is limited mainly to the
approach used in the originating laboratory. Much of the
versatility represented by this program can be credit2d to
the questions and suggestions of many res2archers and
analysts, too numerous to name, from a great variety of
laboratories,


For brevity, the abov2 example showed only one standard,

but it is recommended that the user input compositions and
measured intensities for all available reference materials
that are well characterized and reasonably like the unknown.

To predict relative intensities, one would use a LINES group,
a COMPOSITION group, and the command PREDICT (which has the
sam? form as ANALYZE -- see page 13 for an example).

RESET is an optional command that is useful if different
kinds of problems ar? to be run. Although one can change
data by repeating groups, it is usually best to start a new
Kind of problem (e.g, steel, rather than brass) as though
no previous data had been input. The simple command RESET
accomplishes this by returning the Program to the same
condition it was in when the run began, except that most

. input/output options (pages 18-20) are not affected.

The material presented up to this point covers the

essentials of data input for simple problems. The next
section describ2s alt2rnative ways to specify the incident
radiation, When that information has been consulted as
necessary, the user will be ready to run the kinds of
problems that account for the majority encountered in
practice, The new user should try running such problems, to
test the program and its applicability. Then, the rest of
this manual can be used, as desired, for greater versatility.

3. Incident Radiation

There are several ways to specify the incident radiation,
using data following the incidence and take-off angles input
after CONDITIONS (or under LINES). For monochromatic
radiation there are three forms: by photon 2nergy in keV,

* CONDITIONS 45 45 22.1 KEV
by photon wavelength in angstroms,

* CONDITIONS 45 45 .561 A
and by elem2nt and charact2ristic line,

* CONDITIONS 45 45 AG KA

as from a fluorescer or K-captur? isotope (th2 line
designation may be KA, KB, LAl, LB1, LB2, or MAI).


The following changes are optional.. They permit the incident

. spectrum to be. treated in.mare detail than the original NRLXRF.
Such detail is sometimes. needed; as when very few lines ar2 excited,
or when. the highest-energy line is far removad from the spectrum
cutoff (see. page 37 of the Reference Manual). A new keyword, RMESH,
is allowed: it is used, if desired, in the form "RMESH 1.2".° Ths
valus.of RMESH (1.2 by default) is the minimum ratio of successive
wavelengths sampled from.the incident sosctrum. The smallest value
allowed is 1.013 for. such small values, there can occasionally be
cases. for which the number of wavelength samples would b2 too large
. » for some of the array sizes, and error messages would be output.

1045.1 COMMON/SPEC2/ NW2,.W2{ 80), SP2(. 300), JSP2( 30), RMESH
13042 . COMMON/SPEC2/ NW2, W2( 80), SP2( 300),. JSP2( 30), RMESH
13271 RMESH= 1.2

15043CsMOD BEGIN OMIT FROM NRLEMP
15045 - COMMON/SPEC2/. NW2, W2( 80), SP2( 300), .JSP2( 30), RMESH
15047C2MOD END _ OMIT. FROM NRLEMP
i511 |. HRME/ 3HRME/, HHEL/ 3HHEL/,.HCON/ 3HCON/,. HPAR/ 3HPAR/,
15409 1/7 2X, 52H RMESH QUIT

15411 1 / 2X, 52H FATAL PCT . LONG REMARKS
15421 1/7 2X, 52H PARROT

15834 IF ( HTEST.EQ. HRME) NQ= 9

15839 IF ( HTEST.EQ. HRME) KPRER= |

16941C8SCR READ( KS, 183) HX, XXX
16951 DECODE( 16, 183, HIN( IH)) HXy XXX

16963 IF ( HTEST.EQ. HRME) RMESH= AMAXI( 1.01; XXX)

16965 IF ( HTEST.EQ. HRME) GO TO 2

16967 XUS= XXX

47061 COMMON/SPEC2/ NW2,.W2( 80), SP2( 300), JSP2( 30), RMESH
58041 COMMON/SPEC2/ NW2, W2( 80)} SP2(. 300); JSP2( 30), RMESH
5807 1C 8XXX

5809 1C 8 XXX

58161 K= K+ |

58163 W2(. K)= WEDG( 1)

58165 WT( K)= 0.

58167 NW2T= NLIN+ NEDG+ NEDG- 2

58168 NWERR= 0

58169 WLAST= WEDG( 1)

58171 DO 5 IEDG= 2, NEDG

58173 WIEST= WEDG( IEDG)- 0.0001

58175 17 IF ( NW2T.GT. MNIN- 2) NWERR= NWERR+ 2

58176 IF ( NN2T.GT..MNIN- 2) GO TO 18

58177 IF ( WIEST.LE. RMESH* WLAST) GO TO 18

58179 KSKP= 0

58181 DELW= RMESH* WLAST- WLAST

58183 IF (( WLAST+ 2.0% DELW).GT. WIEST) KSKP= 1

58185 IF ( KSKP.NE. 0) DELW= 0.5*(. WTEST- WLAST)

58187 WTK= DELW/ 3,

58189 WT( K)= WTC K)+ WIK

58191 K= Ke 1

58193 NW2T= NW2T+ 1

58195 W2( K)= W2( K- 1)+ DELW

58197 WIC. K)= 4.% WTK

58199 K= K+ 1


6. Other Features Often Useful

DEFINE is used to define sample components that are not
separate elements (e.g., oxides and fluxes). Once such a
component is defined, it may be used in any subs squent
COMPOSITION group of datas however, definitions created by
DEFINE are deletsd by RESET, and must be repeated if needed
later. For example, lithium tetraborate could be defined by

DEFINE BORATE 1.4 AT

+ be
wo
b

and used along with other defined components in

COMPOSI TION GLASS
BORATE 85

CAO ?

SILICA ?

PBO. ?

be OE

The component name is arbitrary — instead of BORATE, one
could have used LI2B407, or FLUX, etc., subject to the same
rules as sampl? names (page 5). After the name com2s the

- density (which the program us?s only for particle effects —
see pages 24-27). The “AT" tells the program that the
composition will be given in atomic proportions. Instead of
the "AT", one may use "WI", indicating weight proportions.
In either case, the program will automatically scale the
given proportions to 100 p2r cent. The DEFINE command does
not need to b2 used if the definition has been placed in the
permanent data file XRDATC, as 2xplained in Appendix F.
Note that DEFINE defin2s a component, not a sample.

A special one-line form of DEFINE Provides a convenient way
to define a synonym for an element, or for another componant
that is defined (either by DEFINE or the fil? XRDATC)3 Ce dey

* DEFINE IRON EQUALS FE

Synonyms ar? useful for internal standards and wh2n th2re
are several particle siz2s for a singl® component (repeated
use of the sam? nam2 under "COMPOSITION" will change the
data for that name). "EQUALS! may be abbreviated to "EQu,

ELEMENTS is useful if there are any multi-2l2ment

components in a sample. The simpl2 command ELEMENTS causes
the program to output the 2lem2ntal composition of a sampl?
just ANALYZEd (or PREDICTed or SIMULATEd -= s¢2 next pag?).

12


COSMIC PROGRAM # DOD-00065

NRLXRF, A FORTRAN PROGRAM FOR
X-RAY FLUORESCENCE ANALYSIS#

Users’ Reference Manual
and General Documentation

J. W. Criss

X-Ray Optics Branch
Material Sciences Division

July, 1977

NAVAL RESEARCH LABORATORY
Washington, D.C.

Approved for public releas2} distribution unlimited.


anode
kV

deg

filt

Ysqcem

spectrum

el

line num

component

density
AT or WT

proportion

sample?

Kind

woid

tvoid

area

Element symbol of x-ray tub? anode.
X-ray tube operating potential, in kilovolts.

X-ray take-off angle from tube, in degrees with
respect to the anode surface.

Thickness of beryllium x~ray-tube-window, in mm,

The name of the material used to filter the
incident spectrums it may b2 2ither an element
symbol or the name of a material defined in the
data file XRDATC.

Mass~thickn2ss of filter or sample, in grams per
squar? centimeter.

Name of a spectrum tabulated in the file XRDATS.

Element symbol, as for a K-capture isotope, a
fluor?scer, or the anode of an X-ray tube,

A number (e.g., 1, 2,...) that is used to label
the characteristic 2mission line of interest.

The nam? of a component of the samples: either
an 2lement symbol or an arbitrary nam? (only the
first 8 characters will b2 used by the program.
The density, in grams p2r cubic centimeter,

Either "AT" (for atomic proportions) or "wT"
(for weight proportions).

Either the atomic proportion or the weight
proportion of the element in the component,
according to whether "AT" or "WT" was used.

An arbitrary name us2d to identify a sample.
Only the first 8 characters of the name will be
used by the program.

One of the words HOMOGENEOUS, PARTICULATE, or
SEPARATE. (Each may be abbreviated to as f2w as
the first 3 letters)

The volum? fraction occupied by voids.

The averag2 void size, as diameter in
microm2ters.

The sample ar2?a, in squar2? centimeters.

35


ee ee ee ee

ee ea

NAVAL RESEARCH LABORATORY
WASHINGTON, D.C. 20375 IN REPLY REFER To:

_~ AUGUST 1979 UPDATE TO NRLXRF, COSMIC PROGRAM DOD-00065

Ths following modifications are recommended for all installations, and
should be made after the July 1978 and March 1979 updates,

11-487
25681

- 25682 23

47261
47263 15
50223
56223C3 XXX
56231
58043
58413
58703
58852 9902
58853

7 2X, 25H UPDATE NRL JWC AUGUST 719,
IF ( ¥1¢ IS, IY).GE. 0.) KNZ= 1

CONTINUE

IF < HLY€ IY).EQ. HLINEL IND)) GO TO 21
CONT INUE

NZLAST= 1.11

GO TO -4

COMMON/MXS/ MNW, MNINT, MNX, MNY, MNEL, MNOL, MNS
IF ( IIIL.GT. MNW) GO TO 9902

IF. ( INK.GT. MNW) GO TO 9902

CONTINUE

WRITE( KW, 9903) MNW

58854 9903 FORMAT(20H ERROR: NO MORE THAN, 14,21H INCIDENT INTENSITIES,
16H_MAY BE TREATED./37H USE “CONDITIONS” AND THEN “LINES?.)

58855
58856
58857
59401
59403 81
59449
59451 90
59541
59543 72
741-41
74143
74591
74593 12
T7121
77123
77251 16
77253 (15
88681Cz XXX
92441
92443 43
95091
95093 1
95121
95123 2

1

CALL ERROR( 0)

GO TO 15

IF ( XG( N).GE. 0.) NXIND= NXIND= 1
CONTINUE

IF ( YUC IY).GE. 0.) NFREE= NF REE+ 1
CONTINUE

IF ( ROOT(. IX).EQ. 0.) ROOTL IX)= 1,E-30
CONTINUE

IF £ IL.LE. 0) GO TO 11

IF ¢ JWLC IL).LE. 0) GO To 14

IF ¢ PURE( IY).LE. 0.) PURE( [Y)= 1,E-34
CONTINUE

IF ¢ IL.LE. 0) GO TO 16

IF. ( JWLC IL).LT. 1) GO TO 16

IF ¢ ROMZ( IY).LE. 0.) ROMZ( IY)= 1,E-34
CONTINUE

IF (¢ HTEST.EQ. HDIG( J)) GO TO 44
CONTINUE

IF ( TMX.GT. XMX) XMX= TMX

CONT INUE

IF ( TMX.GT. XMX) XMX= TMX
CONTINUE .

Most of these changes are to avoid ending a DO loop on an IF statement,
It has been found that some compilers would translat2 such cod?
incorrectly, without even giving any diagnostic messages,

‘Isers are reminded that suggestions should be directed to COSMIC, since
che X~Ray Optics Branch of the Naval Research Laboratory has not been

2ngaged in the development or support of x-ray fluorescenc?2 analysis
Programs for the past two years. Updates issued by N.R.L. (such as this

one) reflect mainly the suggestions received (via COSMIC) from users.
* Represent changes that are not just avoiding the ending of a DO loop on an IF.


NAVAL RESEARCH LABORATORY
WASHINGTON, D.C. 20375 IN REPLY REFER To:

MARCH 1979 UPDATE TO NRLXRF, COSMIC PROGRAM DOD-00065

The following modifications are recommended for all installations,
and should be made to the July 1978 updated version of NRLX RF
Cincluding the optional chang2s). The chang2s below with -"C:ScRH
should be implemented on systems not permitting ENCODE/DECODE;
those containing "C:BAT” should be implemented on batch syst2ms.

11485 17 2X, 24H UPDATE NRL JWC MARCH 719,
1.1503 KA= 0

13047 COMMON/YNORC/ YNOR( 51, 30)

13523 DO 11 IY= 1, MNY

13524 DO 11 IS= 1, MNS

13525 11 YNOR( IS, IY)= 0.

19437 IF ( RAD2.GT. 3.141597 4.) RADI= RAD2
24226 IF €( NQJEQ. 33) YI( JSR, 1Y)= -1,
24671C8SCR READ( KS, HFE) ( YPAR( IY, 7), IY= 1, KEND)
32411C2 XXX

46783 IF ( RAD2.GT. 3.141597 4.) RAD I= RAD2
47535 IF ( WL.GE. 999.) GO TO 5

47743 GO TO 5

47193 CALL ERROR( 0)

47795 NL= NL- 1

47197 GO TO 6

47801C2 XXX

50271 IF ( NZ.GE. NZLAST) GO TO 4

56223 NEDGC= 0

56231 GO. TO 13
- 69143 IF ( TBARC IX).EQ. 0.) GO To 19
69145 IF ( XUC IX).EQ. 0.) GO To 19

80611 701 FORMAT(Y E16.0/ Al/ E16.0)

91043 DATA NIU/ 5% —997

92713C:BAT GO TO 63

92883CtBAT GO TO 63

The most serious error discovered since July 1978 (at card 80611)
would affect only those who were using the scratch input fil2,
inst2ad of ENCODE/DECODE, and who were also reading d2finitions of
multi-element components from the data file XRDATC. The orogram
would always assume weight orovortions — naver atomic proportions.

The changes at 19437 and 46783 oermit calculation of spectra from
end-window x-ray tubs. Transmission-target tubes ar? not treated.

The other changes are for initializing variables, avoiding minor
2rrors and unnecessary error messages, and Oarroting batch data.

The data file XRDATP should be chang2d, to correct a reversal of the
M IV and MV 2dg2 wavelengths for barium. The aporooriat2 card is

15646 .116900E+02 +155600E+02 .158900E+02 ie) ie)

In general, NRLXRF can treat wav2lengths longer than 12.4 Angstroms only
if all necessary paramat2rs are added to XRDATP. See Appendix F (p 46).


Implementation Instructions

For the Naval Research Laboratory DEC-10 timesharing
computer, implementation is straightforward. The source
Program is copied onto disk and given any file name desired
(e.g., NRLXRF). The data files Provided with this program
ar? copied onto disk with the names XRDATP. XRDATS, and
XRDATC.. ee __i
Optional data files XRDAT2, XRDAT3, and XRDAT4 may be ~~~
created by whatever editor is convenient (e.g, SOS).

Since the magnetic tap? is not in the particular format
required by the PDP-10, one must copy to disk by means of

a program called "CHANGE", The specific timesharing commands
used to establish the disk files at NRL are illustrated
below, where the magnetic-tape identification is "P540", and
the tape unit assigned by the MOUNT command is “MTAOOI",

- «MOUNT MTA? /REELID2P540
«REWIND MTAOO1

- R_ CHANGE

RETAIN

=MTAI2/BLOCKz 4 7REC 180/MODE *EBCDIC/NOREWI ND tALWAYS/ IND
DSKNRLXRF/ REC 280/MODE# ASCIT

RUN

DSK: XRDATP

RUN

DSK *XRDATS

RUN

DSK :XRDATC
RUN

vvvvVVVVVVY

> EXIT
+ REWIND MTAI?
«DISMOUNT MTA1:

Installers are strongly urged to retain the s2qu2nc? numbers
that occur in columns 73-80 of th2 original source file, or
move them to th? position of line numbers, which are handy
for many timesharing systems. These numbers are particularly
useful in checking the program against the listing, and in
making any updates or fixes that might b2 announced later.

Compilation can b2 accomplished, once and for all, by
»LOAD NRLXRF
«SAVE NRLXRF. SAV
-DELETE NRLXRF.REL
Then, th2 program can be run by the command
»RUN NRLXRF

49


J.W. Criss,
"Particle Size and Composition Effects in X-ray
Fluorescence Analysis of Pollution Samples"
Analytical Chemistry, 48, p 179 (1976)
(primary contribution from isolated particles, 2mpirical
correction for analysis)

D.B. Brown, J.W. Criss, and L.S. Birks,
"The Sensitivity of X-ray Films: Part I — A Model
for Sensitivity in the 1-100 keV Region"
Journal of Applied Physics, 47, p 3722 (1976)
(effective absorption coefficients for particulat? bulk
samples) Notes NRLXRF treats a mor? general cas.

31


The auxiliary input files (XRDAT2, XRDAT3, and XRDAT4) may
be used to provide problem set-up data or any other
information that the us2r wishes to acquire from a permanent
file — e.g., the compositions and intensities of standards,
data for test runs, and data for 2xample runs.

The form of data in an auxiliary file is the same as
described in this manual for interactive terminal input or
regular batch input, except that every card image is
preceded by a 6-column field that the program ignores. This
initial field may be used for sequence numbers, which ar?
useful on systems that hav2 editing features for line-
numbered files. The program will automatically add sequenc?
numbers to th? output generated by the commands LIST and
DUMP (described on page 20).

Whenever an “INPUT n“ command is processed, the program will
automatically s2ek the next input from th2 appropriat? file
(either terminal or an auxiliary fil2), and will read the
next card imag? following the last card-image read from that
file (since th? run was begun). Thus, data fil2s may be
exitea and re-entered repeatedly.

PARROT caus2s th? program to output each line of data as
rec2ived. In batch mode, this causes th2 input data to
appear in the appropriate points in the output. For
interactive mode, this option p2rmits the user to see data
as they are supplied by an auxiliary file.

NO PARROT is the ravers? of the preceding: data appear
meshed with the output only when they are input from an
interactive terminal. This is the default option.

REMARKS. permits the program to Parrot "remarks" that are
encountered in a data file (undzr the PARROT option). A
remark is any portion of a card image that begins with the
character “#", Remarks are convenient for adding

descriptive material to data, as in ®xample problems.

NO REMARKS is nearly the opposit2 of the above. A "rama
will not be print2d unless th2 "#" is the first character
read on a card, Whether or not PARROT and REMARKS ar? sot,
the interactive user may add commentary to the run by typing
remarks anytime the program prints a "*!,

RESET (see page 6) does not affect any of th? above input
or output options, except that the PCT option is established.


amount

part. size

n(sig+bkg)

t(sig+tbkg)

n(bkg)
t.(bkg)
d-t

sum

relerr

multl,...

in-file

out-file

material

Weight per cent of a component (exception: it is
the mass per square centimeter, for sampl2 kind
SEPARATE). A "2" means the amount is unknown.
The particle siz2, as diameter in micrometers.

The number of counts for both signal and
background.

The counting tim2, in. seconds, for n(sigtbkg).
If zero, then n(sig+bkg) is assumed to be RXI.

The number of counts for the background,
The counting time, in seconds, for n(bkg),
The detection-system dead tim2, in microseconds.

The fixed total amount for all components (use a
question mark or negative amount if sum is fr22

The assumed relative error in RXI, in per cent.

Multipliers for the measured intensiti2s, in
order of the line numbers.

Either the number 1 (for t2rminal input) or one
of the numbers 2, 3, or 4 (for input from file
XRDAT2, XRDAT3, or XRDAT4).

Either the numb2r | (for output to the terminal)
or the number 2 (for output to fil2 XROUT).

Either an element. symbol or the nam2 of a
material defined in th? fil? XRDATC.

36


8. Input/Output Options

FATAL is a simple command that causes the program to
terminate whenever it detects an input error or a
calculation error that would b2 likely to affect subsequent
calculations in a very serious manner — especially, if an
error in input data would make subsequent data in the group
unintelligible. This option is recommended for batch runs.

NO FATAL is a default option, opposite to FATAL: whenever
possible, the program will print error messages and skip the
calculations, so that the user can input mor? or diffrent
data. Only some kinds of errors are treatable by the FATAL
and NO FATAL options -- for some kinds of input and
computational errors, the computer system itself will cause
the job to terminate. For some errors, the program will
merely output warnings and then proceed with the run,
regardless of the FATAL option setting.

“PCT is a simple command that is equivalent to the default
condition for input and output of composition. All amounts
input under COMPOSITION will be divided by 100 before being
used in the program (e.g., as weight fraction): all amounts
will be multiplied by 100 b2fore being output (e.g., as
weight per cent). This option is automatically reset to
NO PCT (see below) for SEPARATE particles (se? page 27).

NO PCT inhibits the division and multiplication by 100 that
was described above for PCT. This option is useful when the
analyst wants to input amounts as weight fraction, rather
than as weight per cent. NO PCT is also useful in EMPIRICAL
analyses, for which the amounts may b2 in any uniform units
(@.g., mass or mass per unit area).

LONG sets the long form of output, described on pages 15 to
17 for analysis output. The LONG form of output from
PREDICT includ2s th? calculated ratio of RXI to weight
fraction of the fluorescing element, plus othr values
described in Sections 10-12 (pag?s 23-27).

NO LONG is a default options it revers?s th? preceding to
the short form of output.

OUTPUT n caus2s the Program to output to either the
terminal or the file XROUT, according to whather n is | or 2.

INPUT n causes the program to seek input data from one of

four _sourc?s: terminal, fil? XRDAT2, file XRDAT3, or file
XRDAT4 -- according to the value of nt 1, 2, 3, or 4.

18


INDEX TO PROGRAM-INTERPRETABLE WORDS

A (angstroms, photon wav2length units) 6

ALL (used with keyword NORMALIZE) 11, 14

ANALYZE (keyword) 4-6, 12-15, 21, 32, 34, 53-54
AT (for atomic proportions in DEFINE) 12, 32, 35, 46
BFIXED, BFREE (keywords) 22, 33

COEFFICIENTS (keyword) 22, 40, 54, 55

COMPOSITION (keyword) 3-6, 8-9, 12, 18, 20, 25-27, 32, 34
CONDITIONS (k 2yword) 5-7, 14, 21, 32, 54

DEFINE (keyword) 12, 20, 25, 27, 32) 55

DUMP (keyword) 20, 33, 53, 55

ELEMENTS (keyword) 12, 33

EMPIRICAL (keyword) 14, 18, 20, 22, 24, 26, 33, 39-40
END (datum to mark end of file) 43°45

EQUALS (in special form of DEFINE) iB, 25, 32
ERRORS (keyword) 15, 17, 20, 33

FATAL (keyword) 18, 33

FULL (k2yword) 14, 24, 26, 33, 39, 40, 53-54

HELP (keyword) 3, 32

HOMOGENEOUS (sample kind) 20, 23, 25-26, 35, 41-42
INPUT (keyword) 18-20, 33, 36

INTENSITIES (keyword) 4-5, 8-11, 20, 32

KA, kB (lines) 4, 6, 34

KEV (photon energy units) 6, 21, 32, 34

LAI, LBI, LB2 (lines) 4, 6, 34

LINES (keyword) 4-5, 6, Il, 20, 22, 32, 37

LIST (keyword) 9, 20, 33

LONG (keyword) 15, 18, 20, 23, 33

MAC (keyword) 21, 33, 54, 55

MAI (ling) 4, 6, 34

MULTIPLIERS (keyword) 21, 33, 36, 54

NO (keyword modifier) 15, 18-19, 33

NORMALIZE (k2yword) 11, 14, 33, 54

QUTPUT (k 2yword) 18, 33

PARROT (keyword ) 19, 33

PARTICULATE (sample kind) 23, 24

PCT. (keyword) 18, 20, 33

PREDICT (keyword) 6, 13, 18, 23, 26, 27, 32, 54
QUIT (keyword) 3, 32

REMARKS (keyword) 19, 33

RESET (keyword) 6-7, 9-12, 14-15, 18-20, 23, 25, 27, 32
SEPARATE (sample kind) 18, 26

SIMULATE (k 2yword) 13, 20, 32, 53, 54

STEP (keyword) 21, 33, 54

SUM (keyword) 9, 13, te, 33, 36, 54

TEMP (special spectrum nam2) 7, 34

THEORETICAL (keyword) 14, 22, 34, 26, 33, 54

TUBE (keyword) 4, 7, 21, 33, 35

WT (for weight proportions in DEFINE) 12, 32, 35

? (for unknown amount) 9, 13, 25, 36

3 (end-of-record mark) 34

56


In addition to the necessary changes, the following modifications
should bs_made for.(and only for) batch-procsssing operation.

°'345C.8BAT FOR BATCH PROCESSING, ADD LINES-.11346, 18036, AND 18116
346 . CALL.IN( 999, ~4, 2, KEND, HIN)

16036 - GO TO 99

18116 99 CONTINUE

The follawing modifications should be made for compilers that require
a BLOCK DATA subprogram: far initializing variabl2s in COMMON.
The “CsXXX" means delete the original card.

1040.1C XXX
- 1041 1C8XXX
10821C#I1/0. STATEMENT IN THE BLOCK DATA SUBP.ROGRAM.

10866C sDELETE LINES 10401, 10411,° 1087I=-10941, AND 10961--10981¢
1087 1C XXX

1088 1C tXXX

1089 1C 8XXX

1O9O1C 8XXX

1091 LC 8XXX

1092 1C 8XXX

1093 1C XXX

10941C XXX

10961C8XXX

1097 1C 8XXX

1098 1C 8XXX

12001C 8*#**xBEGIN BLOCK DATA

‘Ol BLOCK DATA

-021 - COMMON/KIO/ KR, KS, KW, KEND, IH, HIN( 200), KOUT
12031 COMMON/MXS/ MNW, MNIN, MNX, MNY, MNEL, .MNOL, MNS
12041 - COMMON/HFS/ HFE( 3), HFA( 2)

12051 - COMMON/KUS/ KUC 10)

12061 DATA MNX/ 20/, MNY/ 30/, MNEL/ 20/7, MNW/ 300/
12071 DATA MNIN/ 80/7, MNOL/ 50/, MNS/ 517

12081 DATA KR/ 5/y KS/ 2/, KW/ 6/7, KOUT/ 1/7

12091 DATA KUZ 1, 2, 3, 4, 55 6, 7, 8, 9, 10/

12101 DATA HFE/ 3H( E, 3H16., 2HO)/, HFA/ 3H( A, 2H4)/
12441 END

1212 1C.8%%**xEND . BLOCK DATA

The following modifications should be made for compilers that do not
allow ENCODE/DECODE, and for which the "CsSCR" statements are used.

23139C8SCR READ( KS, HFA) HTST

23233C SCR READ( KS, HFA) HTST

3273 1C 8XXX

46301C 8XXX

46326C sSCR READ( KS, HFE) (.WI¢ IW), SP1( IW), IW= IW, IW2)

The. following changes are necessary. when.NRLXRF is to be implemented
as. two separate programs, NRLSIM and NRLEMP.

-4134C 8XXX
34216C8MOD BEGIN . OMIT FROM NRLEMP
34436C8XXX
34486C.3MOD BEGIN OMIT. FROM NRLEMP


This composition group was necessary becaus® ordinarily the
program will consider all components that have been named
for any samples (including standards). The earlier example
for brass (page 4). showed no explicit COMPOSITION group for
BRASS, since no extra components had besn named. However,
it would be good practic? to always input such a COMPOSITION
group for the unknown.

For a standard (e.g., ADP) the weight per cent of every
component is input. For an unknown sample (e.g., STEEL)

any unknown amount is indicated by a question mark, If any
amount in an unknown sample is known, its value may be input,
whether or not any lin? from that component was measured.
This feature is useful when the analyst has added a flux,
binder, diluent, or internal standard, or when the amount of
some component is fixed by assumption or is known from an
independent analysis method. For ®xample,

* COMPOSITION STEEL
* CR ?

* MN .6

* FE ?

* NI ?

*

In contrast to INTENSITIES, each use of a COMPOSITION group
re-defines the entire composition of the sample (se2 pag? 5).

Usually, there will be no problem with the criterion that
relates the number of measured lines and the number of
unknown amounts in a sampl2: there must be a non-negative
“number of degrees of freedom" for analysis to be possible.
This number usually equals the number of measured lines
minus the number of components with unknown amounts however,
if the SUM of the component amounts is fixed (se2 page 13),
then th? "number of degrees of freedom" is incrzased by one.

The program will rememb2r the input composition and measured
X-ray intensities for any named sample, until the information
is changed by new input for that sampl2?, or until the user
issues a RESET command. For this reason, one should RESET
the program befor? changing to problems that involve
different sampl2 components and measured LINES. (therwise,
inappropriate standards and incorrect intensities might be
used by the program in analyzing the new unknowns.

To list the values of concentrations and intensities that
the program has on hand for a particular sample, one may
issue the command "LIST xxx", where xxx is the sample name
(see page 20 for an example). To list the data on hand for
all samples that are standards, on? may issue the simple
command DUMP (s22 pag? 20).


2222024

25 40627
28...30

31.4240
41
42.44.43

44...48
49
50.665]

5244-55

coefficients in a second degree polynomial
representation of In( tau) vs. In( energy), for
energies (in keV) less than the K-2dge energy,
but greater than the L-III edge energy,

where tau is the photoel ectric-absorption cross
section (barns per atom).

wavelengths of the L-I, L-II, and L-III edges

wavelengths of the L alpha 1, L beta 1, and
L beta 2 emission lines.

(not used by NRLXRF)
L-III edge jump

coefficients in a first degree polynomial
representation of 1n( tau) vs. In( energy), for
energies (in keV) less than the L-III edge energy,
but greater than the M-V edge energy,

where tau is the photoelectric-absorptio cross
section (barns per atom).

wavelengths of M-I, M-IT, M-III, M-IV, M-V edges
wavelength of the M alpha 1! emission line

coefficients in a first degree polynomial
representation of In( tau) vs. In( energy), for
energies (in keV) less than the M-V edge energy,
where tau is the photoelectric-absorpti on cross
section (barns per atom).

(not used by NRLXRF)

Following are example data for lead (atomic number 82)

18201 .510000E+02 0 .113000E+02 .863374E+01 -369400E +01
ie)

18206 -.121312E+01 + 774601E-01 ie)
18216 .140900E+00 -165376E+00 .145970E+00 ie)

18221 .478900E+01 + 177963E+02-.237691E+01~.455883E-0] -781900E+00
18226 .815400E+00 +950700E+00 .117501E+01 +982910E+00 .982210E+00
18241 .246600E+01 +167131E+02~.261538E+01 +321700E+01 .349200E+01
18246 .404700E+01 +475700E+01 .495500E+01 +528600E+01 .145771E+02

18251 -.225279E+01 ie} 0) 0)

47


Making a Simulation-Only Program

To convert from NRLXRF to NRLSIM, as discussed above, one
eliminates 2l2ven subprograms that apply only to analysis:

UNK ITER SETAI ADJB GAMBS
COEFS YBAR ADJB1 SOLV SOLV2
SOLV3

One also deletes other sections of coding occurring between
pairs of comment statements containing the phrase "“QMIT FROM
NRLSIM", The resulting program will then not process th?
keywords ANALYZE, SUM, FULL, EMPIRICAL, THEORETICAL, STEP,
COEFFICIENTS, BFIXED, and BFREE. (ne might also change
FORMAT statements in MAIN and NEXT9 to reflect the program
changes.

Making an Analysis-Only Program
To convert from NRLXRF to NRLEMP, as discussed earlier, one

2liminat2s 31 subprograms that apply only to calculations
using physical theory (i.2., simulation):

COND SNORM YNORM SPEC MAC
SPIN PREP JLDF AF WLF
WEF FLF YXF POINT SORT
SPECW DOTF EXP2F ADJB SIM
SIM2 SIMP EXPIF SIM4 SIMR
SIM6 FHETF EMACF CMACF TUBE
FCHIF

One also deletes other sections of coding occurring between
pairs of comment statements containing the phras? "OMIT FROM
NRLEMP", The resulting program will then not proc2ss the
keywords PREDICT, THEORETICAL, FULL, CONDITIONS, SIMULATE,
MAC, and NORMALIZE (intensities can be scaled by using the?
keyword MULTIPLIERS, which remains valid). To avoid th2
necessity of using EMPIRICAL, chang? th? value of the
variable KONT from | to 2 in th2 appropriate data statement
in subroutin2 NEXTQ; also in that subroutine, chang? one of

the IF statements
from IF ( HTEST.EQ. HRES) KONT= 1
to IF ( HTEST.EQ. HRES) KONT= 2

Also, FORMAT statements in MAIN and NEXTQ should b?2 r2vis2d
to reflect the program chang@s.

54


If the voids volume, voids size, and particle sizes have
been input for a sample, as illustrated abov2, then
predicted intensities will be output when on? issues the
command PREDICT RAWMIX (the sampl? kind has already been set
to PARTICULATE under COMPOSITION). The output for a PREDICT
command has the form described earlier (pages 23-24). The
effects of heterogeneity will be ignored by th2 program if
one issues the command PREDICT RAWMIX HOMOG, but none of the
data will be lost — another command PREDICT RAWMIX PARTIC
will give the same results as before,

In a practical sense, the treatment of particulat? sampl 2s
is us2ful mainly in predicting.the effects of sizes etc. on
measured intensities, which might b2 either greater or less
than for the homog2nsous case. The program can also
calculat2 composition from measured intensities, provided
the user inputs the particl2 sizes 2tc. — information that
usually is not known very w2ll for samples being analyzed,
The preferred method for analysis of particulat?2 sampl2s is
FULL or THEORETICAL, rather than EMPIRICAL (s 22 pag? 24),

The accuracy of calculations for particulate samples suffers
from two problems: practical uncertainty in voids volum:,
voids size, and particle sizes$ and lack of theory to tr2at
the details of particle shapes, ori2ntations, and size
distributions, even if they could b2 Known. If the program
predicts an 2ff2ct greater than about 10 per cent, compar2d
to a homogeneous sample, then ther 2 probably ar? larg?
uncertainties in calculated values.

12. Non-Int2rf2ring Particles

Many environmental sampl2s consist of s2parate particles on
the surfac? of som? substrat2, such as a collection filter.
Unl2ss the particles shadow each other or p2n2trat2 d22p
into a filter that tends to shield them, analysis will be
simple. Specifically, for particl2s with given compositions
and siz2s (under COMPOSITION -- see page 25), th? 2mitted
fluoresc enc2 intensity (above background) will b?2 strictly
proportional to the amount of the emitting element. The
problem for which this program is useful is determining th?
proportionality constant (or, more properly, th? d2psnd2nc2
of this constant on particle compositions and sizes). The
sample kind is specifi 2d by the word SEPARATE following th?
sampl2 name, as illustrated in the following compl 2t2 run:

26


* RESET

* LINES

* 1S KA 57 40 CR45C

*

* DEFINE N2H8S04 1.8 AT
*N2

* H 8

* Si

*0 4

*

* COMPOSITION SULFATE SEPA RATE
* N2H8S04 1.E-6 10

*

* LONG

* PREDICT SULFATE

LINE RXI RXI/C XI/XI0 PH/SR/SR_ —- PH/SR/SR/G
1S KA 0.782433 0.1966E-09 0.8105E-03

The program does not use the angles for SEPARATE particles
— the 57 and 40 merely occupy data positions so that the
x-ray tube (CR45C) may be specified. In the COMPOSI TION
group, th® sample thickness, voids volume, and voids siz2 do
not apply, and are omitted from th2 exampl®. Particle sizes
are input as described on pages 25-26, but the amount of
material is input as grams per square centimeter (the
example is for | microgram/ sq cm), rather than as mass p?2r
cent, which is used for other sampl? Kinds. Th? output
format has been describ2d on pag?s 23-24 for non-thick
samples. RXI and RXI/C ar2 z2ro for SEPARATE: the number
und2r XI/XIO in this example means that the mission of S K
radiation from particles of th? specified composition and
size is only 78 per cent as great as from the same total
mass of sulfur pr2s2nt as infinitesimal particles.

Values of XI/XIO may b? calculated for various compositions
and sizes of separate particles, and for any thin-film
standards (see page 23) that might be us2d to calibrate

the equipment. For mor? information on uncertainties, and
on the use of XI/XIO in a convenient empirical correction

for analysis, consult the annotated bibliography (Criss,
Anal. Chem., 1976]. .

27


APPENDIX D. Format for the Spectrum-File XRDATS

The data file XRDATS contains tabulated incident spectra

that are read automatically by the program whenever they
are referenced by name in a group of LINES data.

Each. spectrum is labeled by a name that begins with a
letter and consists of not more than 8 letters and digits.
The spectrum name must be left-justified in the first 10
character-positions of a lin? (not counting a 5-digit
sequence number and a blank).

For each spectrum, all data besides the nam2 are in
free-field format. That is, data may occur anywhere in a
line (except following a "#"), and are separated from 2ach
other by one or more blanks or commas.

tabulated points. Each tabulated point consists of a pair

of datat a wavelength (in angstroms) and an "intensity" (as
described next).

|
The first datum following the spectrum name is th2 number of |
|

After the numb2r of points (which includ2s both lines and
points on a continuum), on? puts first the lines, arranged
by increasing wavelength. The “intensity” of a line is the
total intensity emitted from the source, in units of photons
per steradian. The intensity units may also include "per
second", "per milliamp", 4‘per millicuri2", or other units
that do not involve wavelength or photons.

After the lings (if any), com2 the points from the continuum
(if any), arranged by increasing wavelength. Th2 first
point must have an intensity equal to zero, to signal the
Program that subsequent points are from a continuum. The
“intensity" of 2ach subsequent point. must be in units of
photons per steradian per angstrom (plus any optional units
used for the lines). The spacing of th2s2 points need not
be equal by wavelength, but should be close enough to permit
acceptable linear interpolation on a graph of log intensity
vs wavelength. Discontinuities (2dges) in a continuum are
represented by having two successive? points with exactly the
same wavelengths the two intensities are for the short-
wavelength and long-wavelength sides of the 2dg2.

After all data for a spectrum, the next spectrum is
formatted as described above, The word "END" in place of a
spectrum name siqals the end of the spectrum file.

Remarks may occur anywhere$ a remark consists of the
character “#" plus the remainder of the line.

43


7. Consistency and Precision

Almost as important as calculated composition are estimates
of accuracy. Unfortunately, accuracy can be checked only
for a material whose composition is well known from other
techniques (e.g., wet chemistry). Since such a comparison
is impossible for most analysis problems, one usually must
be satisfied with estimates of consistency and precision:
consistency of the results with whatever standards and
theories are available, and precision in the sense of
variations in results caused by variations in data. This
section describes the estimates of consistency and precision
that .ar2 produced under the LONG output option.

LONG is a simple command that sets an output option to
include various statistics along with analysis results —
unlike the short form illustrated earlier. The user may
revert to the short form with the two-word command N(Q) LONG.

Under the LONG option, the ANALYZE command caus2s the
Program to output a comparison betw2en the x-ray intensities
measured and th? x-ray intensities calculated by regression
(se2 Appendix C for a description of the analysis method).
The first part of the output has the form

LINE XI MEAS. XI CALC. PCT DIFF ASSUMED
1 CR KA - 7587E+04 .7643E+04 -0.7 +/- 1.0
2 MN KA -6000E+03 .6002E+03 . -0.0 +/- 1.0
3 FE KA ~1294E+05 .1308E+05 -1.t +/- 1.0
4 NI KA -8941E+03 .8950E+03 -0.1 +/> (1.0

The columns, in order, are lin? designation, measured and
calculated x-ray intensities (ordinarily in counts/second),
the per cent diff2rence between these two, and th? assumed
random disagreement (see below). The values in the last two
columns are used to produc? other statistics to be described.

ERRORS is a keyword used to input estimated random errors in
the measured intensities. The assumed per cent errors may be
input for any or all lines:

* ERRORS TESTI

* 23.
* 42,
*

The assumed random error in measur 2d intensities is set to

| per cent relative by default, as illustrated above (under
ASSUMED). For each line, the value input under ERRORS will
become the new default valu? (until a RESET).

15


APPENDIX F. Format for the Physical-Parameters File X RDATP

The data file XRDATP contains various physical parameters
for the elements -- mainly ling and edge wavelengths, and
parameters for calculating absorption coefficients. The
data are read automatically, as needed.

The first 5 columns of 2ach card image are used for the card
number, which is interpreted by the program as follows. The
first 3 digits make a number that equals 100 plus the atomic
number of the element to which the remaining data on the
card apply. The last 2 digits of the card number make a
number that is the “index” of the first of the remaining 5
data on the card, which ar? formatted by the Fortran FORMAT
“1X,5E12.6".

The "index" can range from | to 55. The value of the index
within the line number may be 1, 6, Il, 16, 21, 26, 31, 36,
41, 46, or 51. For each 2lament, the physical parameters

associated with the various indices are given below. Some
indices are not used. The program itself contains data for

fluorescence yields, Auger and Coster-Kronig transition
probabilities.

1 maximum index necessary to treat wavelengths less
than 12.4 A. (the program does. not treat

absorption edges and *mission lines outside this
range?)
2, 3 (not used by NRLXRF)

4....7 coefficients in a third degree polynomial
representation of In( tau) vs. in( energy), for
energies (in keV) greater than the K-2dg2 2nergy,
where tau is the photoel ectric-absorption cross
section (barns per atom).

8...15 (not used by NRLXRF)

16. K-2dge wavelength (angstroms)

17, 18 K alpha and K beta emission wavelengths

19, 20. (not used by NRLXRF)

21 K-edge jump

46


Eliminating Optional Features

Some reduction in cor2 requirements can be made if some
features of NRLXRF are not needed. We offer examples of 2asy
modifications that can be made independently of each other,

MAC keyword to be dropped —
omit subroutine MAC and the reference to it in NEXTQ.

COEFFICIENTS keyword to be dropped -=
omit subroutine COEFS and the reference to it in MAIN.

LIST and DUMP keywords to be dropped —
omit subroutine DUMPS and the two references in NEXTQ.

DEFINE keyword to be dropped —
omit subroutin2 DEFIN and the reference to it in MAIN.

calculation of X-ray tube spectra to be dropped —
omit subroutines TUBE and FCHIF, and in each of
subroutines COND and SPIN, omit the section of coding
between the pair of comment statements containing the
phras? "ONLY IF X-RAY TUBE SPECTRUM IS CALCULATED".

data fil? XRDATC to be dropped --
in subroutine DEFD, omit the four sections of coding
between pairs of comment statements containing the ohras 2
"ONLY IF DATA FILE XRDATC IS USED".

data fil2 XRDATS to be dropped —
in subroutine SPIN, omit the section of coding between
th? pair of comment statements containing th2 phras2
"ONLY IF DATA FILE XRDATS IS USED".

optional input/output files to be dropped —
in the MAIN program, omit the appropriate "CALL FILIO"
statements, according to th? comment statements that
describe the various I/0 devic2s and unit numbers.

By making all thes? modifications to NRLXRF, one shortens
the sourc? code by mors than 700 statements and reduc2s the
cor? requirements by about 7K byt2s. Dropping other features
(except for conversions to NRLSIM or NRLEMP) generally would
produce little savings or would be more complicated. Much of
the cor? r2quirement is a result of the flexibl:2 input and
output features,


ABSTRACT

This is a versatile, user-oriented program for chemical
analysis by x-ray fluorescence. It is suitable for use by
technicians performing routine analysis, by analytical
chemists solving complicated problems, or by research?rs
designing better instrumentation and analysis strat2gies.
The program presumes that the problems ar2 simple? ones; the
user automatically invokes mor? 2laborate treatments just by
providing additional information (as for fluxes, internal
standards, particle sizes, etc.).

Three general kinds of samples may be treated, according to
physical characteristics: (1) homogenzous (any thickness),
(2) particulate (bulk, any thickness), and (3) separate
particles that do not shadow each other. The automatic
calculation method for analysis is a continuous bl 2nd of
empirical regression techniques and physical theory. In
effect, theory provides the shap2? of the calibration
relationships, which ar? then scaled to agree with the
measured standard refer2nc? materials most like the unknown
sample, When very few standards are available, or wh2n the
standards are quite different from the unknown, then the
burden is on theory to hav2 the correct shape over a range
of compositions. On the other hand, when ther? is 2v2n one
standard similar to the unknown, then it matters very little
what errors might exist in the theory or in the fundamental
parameters (absorption coefficients, spectra from isotopes,
fluorescers, or x-ray tubes, etc.).

Theoretical intensity calculations use the formulas of
Gillam and Heal for primary and secondary contributions in
homogeneous samples, plus a thickness correction from
Compton, Particulat? sampl2s are simulated with the same
formulas, but with the substitution of effective absorption
coefficients to account for the overall 2ffscts of
heterogeneity on x-ray transport, plus other formulas of
Criss for the fluorescence production rates in individual
particles. The incident radiation spectrum is treated by
numerical integration (a composite of trapezoid and Simpson
rules), The program can calculat? very us?ful approximations
to x-ray tube spectra, using modifications of formulas due
to Kramers, Green and Cosslett, Philibert, and H@inrich.
Fluorescence yields (including effects of Auger and Coster-
Kronig transitions) ar? calculated using formulas and data
in Bambynek et al. Data files provided with the program
include line and edge wavelengths of Bearden and Burr
parametric representations of absorption coeffici2nts from
McMaster et al., and tabulated X-ray tub2 spectra from the
measurements and calculations of Gilfrich et al. and Brown


In the outline above, a phrase enclosed by "< >" denotes a
datum that is input (either a number or a word). To input
data, provide all words not enclosed by "< >", and provide
the data in the appropriates places. (but without the 4t< >),
A keyword may be abbreviated to its first three letters.

The symbolism “<etc>" means that additional lines of data
may be input in the same format as the line above, and
that the entire group of data is terminated by a blank lina.

The symbolism ""<sample> ..." means that wher2v2r <sampl2>
may be input, it may be followed, on the same line, by the
additional data for <sampl2>, as shown for COMPOSITION.

Under LINES, “"<spl> <sp2> ..." represents data spl thru sp6.

A word in parentheses — @.gey."(NO)"-— is optional. Data
following a "[" are optional, if default values have been
established by the program or by 2arlier entries. An

additional featur2 of the input style is that a semicolon
(3) may be used instead of an end-of-line. Thus, one card
(or card-image) can contain data that would oth2rwis?2

require separate cards — 2.9., "LONGs NO FATAL} ANALYZE",

Next are definitions for th2 data items referred to above,
angl ang2 X-ray incidence angle and take-off angl?, in

degre2s with respect to the sampl? surface.
spl sp2 ... Data that specify the incident radiation.

There are 6 ways to do this, as described in
Section 3 (pag2s 6-7):

spl sp2 sp3 sp4 sp5 spd
an ergy "kev
wavelength "A"
element line
anod2 kV deg mm filt g/sqem
spectrum filt g/sqcm
"TEM PH Tilt g/sqcem
ener cy The photon energy, in keV.

wavelength The photon wavelength, in angstroms.

element Element symbol.

line On? of the following six abbreviations for
lines: KA KB LAI LB! LB2 MAI

34


APPENDIX A. Summary of Input Formats

Data on a singl? card-image must be separated by one or mor?
blanks and/or commas. . The data groups may b? input in any
order (unless default data are to b2 changed), just so the
necessary information has been input before calculations are
made¢. Data may be changed by repeating a group. The
symbolism is described at the-end of this outline.

HELP

RESET

. QUIT

CONDITIONS [<angl> <ang2> <spl> <sp2> <sp3> <sp4> <sp5> <spé6>
CONDITIONS [<angl> <ang2> <snergy> KEV

CONDITIONS [<angl> <ang2> <wavelength> A

CONDITIONS (<angl> <ang2> <el> <line>

CONDITIONS [<angl> <ang2> <el> <kV> <deg> <mm> <filt> <g/sqem>
CONDITIONS [<angl> <ang2> <spectrum> <filt> <g/sqcem>
CONDITIONS [<angl> <ang2> TEMP <filt> <g/sqcem>

LINES

<line num> <element> [<lin2> <ang!l> <ang2> <spl> <sp2> ..,
<etc>

DEFINE <component> <density> [<AT or WT>

<element> <proportion>

<etc>

DEFINE <component 2> EQUALS <component 1>

COMPOSITION [<sample> <kind> <g/sqcm> <vvoid> <tvoid> <area>
<component> <amount> [<part. size>

<etc>

INTENSITIES [<sample> ...

<line num> <n(sig+bkg)> (<t(sigtbkg)> <n(bkq)> <t(bkg)> <d-t>
<etc> :

ANALYZE [<sample> ...
PREDICT [<sampl2> ...
SIMULATE [<sample> ...
32


changing data 3, 5, 6, 9-10, 21, 25, 32

changing array sizes 37, 53-54

chi 16-17, 40

COEFFICIENTS (k 2yword) 22, 40, 54, 55

coefficients (se? “influence coefficients")

collimators 24 :

column position of input data 3, 19, 32, 43-47

commands — see specific keywords

commentary (see "remarks*")

compilation of program 3, 30, 48-49, 51

components 4-5, 8-9, 11-14, 16, 17, 20-22, 25, 32,
35-40, 51-53

COMPOSITION (keyword) 3-6, 8-9, 12, 18, 20, 25-27, 32, 34

compounds 5, 7-8, 12, 20, 25, 35-36, 45, 50-52, 55

computer requirements 48-49

CONDITIONS (keyword) 5-7, 14, 21, 32, 54

consistency among int®nsities 2, 5, 15-17, 40

constraints on calculations 9, 11, 12-14, 16-17, 20, 40

continuum in incident spectrum T, 24, 37, 41-44

convergenc? criteria 21, 39

core requirements 48, 53-55

cost of runs 1, 14, 21, 38, 46, 53

Cost2r-Kronig transitions 41, 46

count rat? 5, 10-11, 13, 15, 20, 36, 42

counting time 5, 10-11, 36

counts, raw 5, 10-11, 36

cross-sections 1, 21, 41-42, 46-47

crystal 2ffici2ncy 24

data analysis methods 38-42
data groups 5-6, 8-10, 12, 18, 20-21, 25, 27, 32, 34, 43
dead time 5, 10-11, 21, 32, 36
default values 3, 5, 7, 10-11, 13-15, 17-19,
22-23, 25, 32, 34, 36, 39, 53
DEFINE (keyword) 12, 20, 25, 27, 32, 55
degrees of freedom 9, 16, 21, 40
density (g per cu cm) 12, 35, 45
detector efficiency 24, 42
dilution 9
dimensions (units of measure)
se? specific quantities, such as "angles", "mass"
disk files 1, 18-20, 33, 36, 48-51, 53, 55
drift 2i
DUMP (keyword) 20, 33, 53, 55

2dges, absorption 37, 41, 43, 46-47
effective absorption co2fficient 41
effective pur2-2l2mant intensity 42
efficiency of crystal, d2t2ctor, 2tc. 24, 42

58


The physical theories and associated “fundamental parameters"
that the program uses will not be detailed in this reference
manual, since those things are taken care of automatically,
It is sufficient for the user to know which xperimental
conditions and sample characteristics to supply.

Unlike most previous calculation methods, this program does
not require the analyst to make an absolute choice between
strictly “influence-coefficients" and strictly "fundamental-
parameters" treatments. Instead, the program automatically
uses a new combined approach (see Appendix C) that includes
whatever reference standards the user provides, together
with the physical theory found to be best for fast, accurate
analysis. Theoretical calculations ar? automatically
adjusted to make them conform to measured intensities from
standards. Still, the analyst has the option of using

an empirical regression method alone.

Whatever scheme is used, the analyst can obtain useful
estimates of precision in calculated concentrations, plus
estimates of consistency among measured (and calculated)
intensities. The program can treat data from many different
kinds of samples, measured under a great variety of

ex perimental conditions, and thus can b2 useful not only

for performing chemical analysis, but also for improving
analysis strategi2s and experimental techniques.


APPENDIX E. Format for Compounds-Definition File XRDATC

The data file XRDATC contains definitions of multielement
materials, for automatic access by the program NRLXRF.

The name of a compound (or other fixed combination of
-elements) consists of a word beginning with a letter, and
containing. not more than 8 letters and.numerals. The name
is left-justified in the first 11 character-positions ofa
fard-imags (not counting a 5-digit card-number and a blank).
The remaining data for each compound may occupy any
character-positions after the first 11, and ar? in free-form
format. That is, data May occur anywhere in a line (except
following a “#'), and are separated from each other by ons
or more blanks or commas.

After the name, the first datum is the density (grams per
cubic centimeter)s the next is either an "ATH or a “WT,
according to whether the elemental Proportions ar? to b?2

input by number of atoms or by weight. The next datum is
the number of elements in the compound. Next are the pairs
of element symbols and proportions.

The data for a compound may occupy more than one lines
however, lines after the first (which contains the nam)
should be blank in the first 10 character-posi tions.

The word "END", placed as though it were a compound name,
Signals the end of the list of compound~definitions.

Remarks may occur anywh2re$ a remark consists of the
character “#" plus the remainder of the line.

Below is an example file XRDATC, including the arbitrary
line numbers.

10010 EARTH 2.7 WT 8

10020 Q 47 SI 28 AL 8 FE 5 MG 2 CA 3.6 NA 3 K 2.6
10030 AIR 0.0012 WIT 2N .8 0 .2

10040 FIRE 0.0006 AT 4C3H408N 28

10050 WATER 1. AT2H201

10060 ETHER 2.E-29 ATI H1

10080 MYLAR 1.40 AT 3C5H402

10110 CACO3 2.71 AT3 CA1C103

10150 AL203 3.97 AT 2 AL 203  # ALPHA ALUMINA
10160 SI02 2.64 AT 2 SI 102 # ALPHA QUARTZ
10180 IRON - 7.87 AT 1 FE 1 .

10200 cB 8.58 AT 1 NB 1.

10210 L12B407 1.4 AT 3 LI2B407

12345 END # MARKS THE END OF THE FILE XRDATC

45


The device assignments summarized above ar? all made in the
subroutine FILIO, which would need to be modified slightly
for computers other than the DEC-10. Specifically, FILIO
uses the Fortran-callable system. routines OPEN and CLOSE.
For each file, data are acc?ss2d s2quentiallys all data are
presumed to b? ASCII (rather than binary)s no fil? is both
read and written (unless unit 2 is us?d — se2 next section):
each file is automatically saved upon normal termination of
the program (not all files are released explicitly with a
CLOSE command). The detailed descriptions of the OPEN and
CLOSE commands may be found in the appropriat® DEC manuals
— €+9e, DECsyst2m-10 Fortran-10 Language Manual.

Subroutine FILIO contains comments that suagest analogous
commands for us? on CDC Kronos timesharing. Subroutine
FILIO is called from the main program, from subprogram SPIN,
from subprogram AF, and from subprogram DEFD.

Free-Field Input

User-supplied input is read by subroutine IN2, which picks
off the appropriat?2 number of data from a card imag? of
free-field input, and then ENCODEs the data in a format that
is easily DECODEd. The various subprograms acquire such
user~suppli2d data by calling subroutine IN, which calls IN2;
then the data are made available by DECODE stat2ments
following the calls to IN. An alternativ2 method is
available for compilers that do not allow ENCODE and DECODE :
one may disabl?2 all ENCODE and DECODE statements, and
implement th2 statements (now comments) starting with
"CsSCR"3 in that Way, one replaces th? ENCODE/DECODE method
by WRITEs and READs of the disk file XRSCR (unit 2 in the
table above).

Subprograms Handling Input

The only READ statements in the program (unless DECODE
statements hav? been disabled) occur in the subprograms
SPIN, DEFD, AF, and IN2. Subroutine SPIN obtains tabulat2d
x-ray sp2ctra from the data file XRDATS, where only the
spectrum name is formattad -— other data are in free-field
form (see th2 Users’ R2ference Manual, Appendix D). Lik?
SPIN, subroutine DEFD requires only the nam? of'a compon 2nt
to be formatted (in the file XRDATC). Function subprogram AF
reads the data fil:2 XRDATP, which contains only formatted
data. Subroutin?2 IN2 reads all free-field input (from the
t2rminal, from regular batch input, or from th2 data files
XRDATS, XRDATC, XRDAT2, XRDAT3, or XRDAT4).

51


2. Simple Analysis Problems

The following simple example is for analysis of a brass,
using just. one standard reference material. Only four
different keywords are required: LINES, COMPOSITION,
INTENSITIES, and ANALYZE. Following the complete example
run, the input formats are explained (also see Appendix A).

User-supplied information is indicated by stars (printed by

the program in interactive runs} normally abs2nt in batch
runs). The other indented material is output by the program.

LINES
1 CU KA 57 40 W 50
2 ZN KA °

bb

COMPOSITION SRM1102
CU 72.9
ZN 27.1 ‘

ob

INTENSITIES SRM1102
. 1 23957
2 31826

ed

+

INTENSITIES BRASS
1 22873
2 35249

bE

*

ANALYZE BRASS
COMPONENT AMOUNT

CU 69.57
ZN 30.15
(TOTAL) 99.71

LINES introduces the list of measured lines and their
measurement conditions. Th? lines are numbered, in any
order, using the numbers 1, 2,..., nN, where n is the number
of lines$ the list is ended with blank input. The lines
are designated by element and one of the six abbreviations
KA, KB, LAI, LBI,.LB2, MAl. After each line abbreviation,
the user may put the x-ray incidence and take-off angles

(in degrees, with respect to the sample surfac®), Following
the angles, the user may specify the incident radiation —
by x-ray tube target and kV, as above, or by other means,

4


THE UNIVERSITY OF GEORGIA OFFICE OF COMPUTING
AND INFORMATION SERVICES

COSMIC PROGRAM # DOD-00065

SUPPLEMENTAL DOCUMENTATION

DISTRIBUTION FORMAT

The standard distribution format for this program is as an unlabeled
9 track magnetic tape recorded at 800 BPI and containing four physical
files. Each file contains unblocked 80 EBCDIC character card image

records.

FILE CONTENTS

NRLXRF Program Source Code

Sample Physical-Parameters File XRDATP
Sample Spectrum File XRDATS

Bw NB

Sample Compounds-Definition File XRDATC

Computer Software Management and Information Center
SUITE 112, BARROW HALL, ATHENS, GEORGIA 30602, (404) 542-3265

AN Equa: neene-



As illustrated next, these include th2 sample kind, its
mass~thickness (grams per squar? centimeter), the volume
fraction occupied by voids, and the effective size of
individual voids (as diameter, in micrometers)?

* COMPOSITION RAWMIX PARTIC 100 .2 10

A larg® value of mass-thickness (e.g., 100) may be used for
samples that have effectively infinit2 thickness. Another
datum that may be input at the end of such a list (for any
sample kind) is the area of the sample (in square cm) that
is both irradiated by the incident x-rays and viewed by the
detection system. The initial default values for all data
after a sample nam? ar? HOMOG 10000 1. Once input for

a specific sampl2 name, they do need to be repeated with
subsequent uses of that name. Moreover, the current values
of these data will be the new default values, to be used for
any sample name not y2t mentioned (until the next RESET).

A complete description of the physical characteristics of a
bulk particulate sample requires the information described
above, plus the nam2s and particl2 sizes of all the
different mat2rials in th? sample. For each component
listed under COMPOSITION, one may input the particl? size
(as effective diameter, in micrometers), following the
weight per cent, as illustrated by the data groyp

* COMPOSITION RAWMIX PARTICULATE 100..2 10
* CACQ3 80 30
* SI02 16 40
* FE203 4 25
*

The component names should be already defined, 2ither by the
DEFINE command (see pag? 12) or in th2 data file XRDATC
(Appendix D). Th? initial default values for particle sizes
are zeros. OQnc? a value is input for a component, it will
becom? the new.default value for that component in future
COMPOSITION groups (until the next RESET). If the
percentages of th? components ar? unknown, those numbers

can b? replaced by question marks. If one wants to predict
the intensities from a sample with s2v2ral sizes for one
component, the components can b2 repeated under COMPOSITION,
with the appropriat2 weight per cent and particle size used
gach tim23 how2ver, one must use synonyms, becaus? a s2cond
entry for the same name will r2place the data for that name.
Synonyms can be? d2fined by one-line commands:

"DEFINE SILICA EQUALS SI02", "DEFINE PLATINUM EQ PT", etc.

25


SUM is used when the analyst wants calculated compositions
to have a specified sum (%.g., in weight per cent). Input
any tim® prior to an ANALYZE command, SUM has the form

* SUM 100

A question mark or a negative value (the initial default)
causes the total to be unconstrained. When the sum is fixed,
it does.not simply cause the calculated amounts to be re-
scaled, but is used as additional information (a "side
condition") in the calculation procedure}3 usually, minor
concentrations ar? aff2cted much less than major amounts.

The output from an ANALYZE command indicates when the SUM

(or the amount of any component — se2. pag? 9) is fixed:

COMPONENT = AMOUNT

CR 17.76
MN 0.6000 (FIXED)
FE 69.44
NI 12.20
(TOTAL) 100.0000 (FIXED)

PREDICT causes the program to calculate th2 theoretical
relative x-ray intensities (RXI“s) for any sample whose
complete COMPOSITION has been defined. For each line, RXI
is the ratio of x-ray intensity from the sample, divided by
the intensity from a thick, homogsneous, pure-element
standard under the same exp2rimental conditions. RXI is
simply a unit of measur2$ its use does not necessarily imply
that the pur2 element is measured. An example of PREDICT is

* PREDICT SAMP1
LINE RXI

1 CR KA 0.172238
2 FE KA 0.480056
3 NI KA 0.037609

SIMULATE is identical to PREDICT in the form of the command
and in the output. The difference is that under SIMULATE
the program will also calculat? intensities in absolut?
units (counts p2r second), on the basis of m2asured
intensities that have been input so far for standards. Then,
these calculated intensities will be saved, to be used later
just as if they had been measured and input. The adjusted
intensities may be observed in the output from LIST (see
pag? 20). SIMULATE is useful if the analyst wants to use
the cheaper EMPIRICAL option (see next Page) for routine
analysis, but wants to consider. a few hypothetical standards
in addition to the real standards.

13


is THE UNIVERSITY OF GEORGIA OFFICE OF COMPUTING
AND INFORMATION SERVICES

NOTICE

This program or document is disseminated under the
sponsorship of the National Aeronautics and Space
Administration in the interest of information exchange.
The United States Government assumes no liability for
its contents or use thereof.

Any problems associated with either this documenta-
tion or the computer program associated with this
documentation should be directed to COSMIC and not
to the author or developer in order that errors may
be documented and referral services coordinated by
COSMIC.

This computer program is intended for installation
on a hardware/software configuration which is identi-
cal to the configuration on which the program was
developed. COSMIC cannot provide assurance that

this program will execute properly on any hardware/
software configuration other than that on which it
was developed.

THIS DOCUMENT REPRODUCED FROM BEST AVAILABLE COPY

Computer Software Management and information Center
SUITE 112, BARROW HALL, ATHENS, GEORGIA 30602, (404) 542-326!

AN EQUAL OPPORTUNITY/AFFIRMATIVE ACTION INSTITUTION


APPENDIX C. Calculation Methods Used for Analysis

In both the gsn2ral approach and in computational details,
this program includes several methods that hav? not been
used before in x-ray fluorescence analysis. However, this
manual is intended for analysts, rather than mathematicians
or other theorists, so the outline below describes the
general approach in terms of basic data-analysis conc2pts,
merely mentioning the calculation techniques, and not
dwelling on the novelties. Following sections discuss the
regression methods and the physical theory.

General Approach

The program calculates composition in a way that is quite
analogous to the familiar m2thod of establishing and using a
calibration curve for a binary sample. There are four basic
parts to the problem: (1) what known points — i.2., what
standards — are to be used, (2) what shape of curve should
fit them -- straight line, 2tc., (3) how is the particular
curve established — i.2., how does one fit the data bast
with the shape chosen, and (4) what composition corr2sponds
to the measured intensities, according to the calibration
curve, For binari2s, on? can do the calibration, analysis,
and assessment of results in a straightforward and natural
way — by "eyeball",

Fundamentally, the program automates this familiar analysis
concept. Th? difference between the graphical approach and
the computer program is not so much a matter of concept as a
matter of compl2xity and detail. In general, a sample has
more than two components, each affecting every m2asur2d
intensity, so the mental picture of a two-dimensional graph
no longer works. Moreover, a digital computer operates at

a very primitive level (arithmetic) and so it must be
programmed in agonizing detail. There is no singl? best

way to program a computer for the analysis problem, any more
than there is a best "2yeball" method. The numerical
methods were devised to satisfy, as well as possible, the
competing goals of accuracy, flexibility, speed, and
interpretability (in terms of common statistical conc2pts),.

There is one additional concept used that is not part of the
traditional approach. In most previous graphical and
numerical techniques, there were two separate stages: first,
the calibration curve was determined, and second, it was
used to find compositions of unknowns. This program goes
through both stages automatically for each unknown sampl?,
rather than using the same calibration for all samples of
the same general type. The advantage her? is that the

38


9. Further Versatility

STEP is used in the same way as ANALYZE, but it causes
only one step of the iteration to be calculated. With STEP,
the analyst can observe successive estimates of composition,
and verify the convergence. In normal analysis, the
iteration will stop, and answers will be output, if any one
of three convergence criteria is satisfied: (1) the relative
change in amount, for every component, is less than 0.0005,
(2) the number of degrees of freedom (pag? 16) is positive,
and the relative change in calculated intensity, for every
line, is less than 0.2 times the assumed relative error, or
(3) the number of estimates (iterations) is 12. The number

of estimates and the criterion satisfied are shown in LONG
output by one of the forms

ESTIMATE 3% COMPOSITION CONVERGED.
ESTIMATE 4: INTENSITIES CONVERGED.
ESTIMATE 12: ITERATION LIMIT.

MULTIPLIERS introduces a list of one or more multipliers,
which can be used to compensate for equipment drift, chang2s
in detector response, etc. between the measurements of
various samples. If one multiplier is input, for example

* MULTIPLIERS 1.02

then all subsequent intensities input under any INTENSITIES
groups will be multiplied by the multiplier (e.ge, 1.02),
after correction for dead-time. If there are different
multipliers for the different lines, they are input in the
order of the line-numbers; for example,

* MULTIPLIERS 1.02 1.04 1.03

MAC caus?s th? program to output the x-ray photo2lectric
mass absorption coefficient of a nam2d material, for x-rays
with an energy (or wavelength) sp2cified by two data, as
under LINES (but no polychromatic radiation). For exampl2,

* MAC NI 22.1 KEV
23.7680

TUBE causes the program to calculate and output the spectrum
from an x-ray tube with specified anode, kV, take-off angle,
and window ‘thickness (as under CONDITIONS page 7)3 e.g.,

* TUBE W 50 30 1
will produce output with the format described in Appendix D.

21


L.S. Birks,
X-Ray Spectrochemical Analysis
Interscience, New York (1969)
(tabulated spectra for copper and molybdenum x-ray tubes)

W.H.McMaster, N.K. del Grande, J.H. Mallet, J.H. Hubb?21l,
"Compilation of X-ray Cross Sections"
Lawrence Radiation Laboratory rept UCRL-50174 sec II rev
(x-ray cross sections, from tabulated parameters)

Eugene P. Bertin,
Principles and Practice of: X-Ray Spectroch2mical Analysis
Plenum Press, New York (1970)3 or 2nd Edition (1975)
(general text for physical theory and experimental method)

K.F.J. Heinrich,
Present State of the Classical Theory of Quantitativ:
Electron Probe Microanalysis
Nat. Bur. Stand. (U.S.) Tech. Note 521 (1970)
(formula for "Lenard coefficient" in Philibert’s 2quation)

J.V. Gilfrich, P.G. Burkhalter, R.R. Whitlock, E.S. Warden,
and L.S. Birks,
"Spectral Distribution of a Thin Window Rhodium
Target X-Ray Spectrographic Tube"
Analytical Chemistry, 43, p 934 (1971)
(tabulated spectrum for rhodium tube)

W. Bambyn2k, B. Crasemann, R.W. Fink, H.U. Freund,
H. Mark, C.D. Swift, R.E. Price, P.V. Rao,
"X-ray Fluorescenc2 Yields, Auger, and Coster-Kronig
Transition Probabilities"
Reviews of Modern Physics, 44, p 716 (1972)
(probability of emission of a specified characterstic
photon from an atom, given photoelectric absorption of
a photon in a specified subshell)

S.D. Rasberry and K.F.J. Heinrich,
"Calibration for Int2rel2ment Effects in X-Ray
Fluorescence Analysis"
Analytical Chemistry, 46, p 81 (1974)
(summary of empirical methods)

D.B. Brown, J.V. Gilfrich, and M.C. Peckerar,
"Measurement and calculation of absolute intensities
of x-ray spectra"

Journal of Applied Physics, 46, p 4537 (1975)
(tabulated spectra for chromium and tungsten tubes)

30


The program computes a “normalized chi-square" value that
can be used to assess th® overall consistency of measured
fand calculated) intensities. "Chi", the square root of
this value, is perhaps easier to interpret. It is output in
the form

CHI= 1.35 (EST. RMS RATIO OF OBSERVED TO ASSUMED PCT DIFF)
FOR 1 DEGREE OF FREEDOM.

This output indicates that chi is an estimate of the root-
mean-squar? ratio of observed per cent difference to assumed
average disagreement. This estimate is more dependable as
the number of degrees of freedom is greater. In the example,
that number equals | -—- i.2., 4 independent intensity
measurements, minus 4 components to be found, plus one
constraint (SUM 100). Without this constraint, there would
have been 0 degrees of fresdom, and the value of chi would
have been undefined — that is, there would have been no
basis for assessing the consistency among measured and
calculated intensities: one would expect exact agreement for
each line, in spite of possibl2 2xp2rimental and theoretical
errors,

If chi is on the order of | (as in the exampl2), then there
is general consistency among the statistical assumptions and
the observed results; if chi is much different from 1, then
there is general inconsistency, and the analyst should try
to discover why. Chi is really an 2stimate of what one
might expect in the analysis of many samples having
approximately the sam? composition, rather than a precise
measure of 2rrors for the particular sample just run. A
singl2 valu2 of chi is useful mainly as a warning of extreme
?rrors. It is better to view chi on the average, for
several samples.

A rough interpretation of chi values is as follows. If the
program is using assumed errors of | per cent, and if the
average chi is about 3, then there is reason to suspect that
the random 2rrors in intensities. (or disagreements with
calculated int®nsities) are more like 3 per cent, on the
averag?. Similarly, if the user has input specific estimates
of intensity errors, and if chi is generally on the order of
0.5, then perhaps the user has overestimated the: 2?rrors by

a factor of two, on the averages. Qn? should b® aware that
chi is based on theori2s of random 2ff2cts, so it might not
be an accurate? measure of systematic differences. Mor2over,
the program does not consider any errors in th? compositions
of standards or in th2 amounts of fixed components, for

the calculation of 2ither chi or imprecision in composition
(s22 below).


CONTENTS
ABSTRACT
FOREWORD

INTRODUCTION

RUNNING COMMON. PROBLEMS

1. Input Style
2. Simple Analysis Problems
3. Incident Radiation

ADDITIONAL FEATURES

4. Samples and Compositions

5. X-ray Intensities

6. Other Features (Often Useful
7. Consistency and Precision
8. Input/Output Options

9. Further Versatility

NON-IDEAL SAMPLES

10. Finite? Thickness
'1. Bulk Particulate Samples
12. Non-Interfering Particles

ANNOTATED BIBLIOGRAPHY

APPENDICES

As Summary of Input Formats

B. Program Limits

C. Calculation .Methods Used for Analysis

D. Format for Spectrum-File XRDATS

E. Format for Compounds-D2finition Fil? XRDATC
F. Format for Physical-Parameters File XRDATP
G. General Documentation for Implementation

H. Program Architecture

I. Program Modification

INDEX TO PROGRAM~INTERPRETABLE WORDS
GENERAL INDEX

ili

AanW

10
12
15
18
2l

23
24
26

28

32
37
38
43
45

50
53

56
57


APPENDIX I. Program Modification

This Appendix discusses modi fications designed mainly to
reduc? core requirements, either to save running costs or to
implement the program on small2r computers —- perhaps even
the larger minicomput2rs, if they have floppy disks or other
high-speed multi-channel I/O Capabilities. Three approaches
will be mentioned: changing array siz2s, making s2parate
Programs, and eliminating optional features.

Changing Array Sizes

On the NRL DEC-10 system, core requirements can be reduc ed
from about 58K to as little as about 30K just by chang2s in
array sizes. Comment statements at the beginning of the main
program are d?signsd to h2lp the Programmer make such
chang?s. Ther? are saven integer variables in the labeled
common /MXS/ that are set in a DATA statement and then used
throughout the Program _to t2st input data and calculations
against array siz3s. These sev2n parameters include the
maximum number of samples that may be treated tog?ther, the
maximum number of components, 2tc. The array sizes that are
consistent with th? values of th2s2 parameters are given in
comment statements following COMMON statements in the main
Program, and following many DIMENSION statements 21s ewhere.

Making Separate Programs

The major functions of the program can be separat2d into
simulation and analysis. The full program combin2s thease
two kinds of calculations automatically, under the default
analysis option (FULL). However, the analyst may simulat2
specified hypothetical standards and use them along with
m?asur2d standards in the empirical r2are2ssion analysis of
unknown materials (se2 keywords SIMULATE and EMPIRICAL).
This analysis scheme can b?2 implemented just as well with
two s2parat2 programs -—- one proaram would us3 physical
theory as necessary to calculate 2xpected x-ray intensities
from standards, and output the results in Drogram-readable
form (s32 k2yword DUMP) the other program would us?
simulat3q and measur 2d intensities to analyz? unknowns, and
would not use any "fundamental parameters" or physical
formulas. Two separat? programs (NRLSIM and NRLEMP) can be
created from NRLXRF in a straightforward way, as described
below. Each of them requires simificantly less core than
the full program. The analysis-only Program (NRLEMP) offers
the createst savings in core, ?sbd2cially if one also reduc?2s
array sizes and drops optional features,

53


calibration. process. its2lf is influenced by the. observed
intensities from each unknown: the curve is fit to th?
standards in a "local" sense (i.e., it is required to agr 22
with thos? standards most similar to th2 unknown in
intensities), rather than in a “tglobal" sans2 (a compromise.
fit to all standards).

The mathod of automating these conc2pts is 2ssentially a
multivariate nonlinear inv2rs2 regression. The "model"
(i.e., the math2matical function for the calibration curve)
is a slight gsn2ralization of that used by Lachanc? (1964)3
its parameters ("influence coefficients") ar2 det2rmined
by a weighted least-squar2s. proc:dur? with local emphasis.
The composition of th? unknown is obtained by solving the
mod2l equations for the amounts of the compon2nts, taking
account of any fixed amounts and fixed total amount.

For EMPIRICAL analysis, th? standards us2d in the regression
are all the standaras defined by the user. For the FULL
analysis option (which includes ohysical theory), th? sam2
regression method is used, but standards ar2 us2d in an
indirect fashion. In particular, th? r2gr2ssion is not done
on the us?r-defin2d standards, but on "Simulated" standards,
Simulatad standards consist of hypoth2tical compositions

and corresponding theoretical int2nsiti2s g2n2rated
automatically by the program. Th? us 2r-defined standaras
are used to adjust th? theoretical calculations, to mak?
them agree with th real standards that ar? most similar to
the unknown.

When the FULL option is us2a (th2 default situation), there
is also an automatic iteration of a simulation-r 2gr2ssion
cycle. For 2ach successive estimat? of sampl2 composition,
the program scales the amounts to 160 p2r cent, simulates a
standard with th? resulting composition, adds it to th?
existing list of simulated standards, and r2pzats tne
regression to obtain the next estimat? of samol2 composition.
The simulation-regression cycl2 is r2p2ated until one of the
three converg2nc? crit3ria is satisfied (see STEP, pag? 21).
When the iteration is finished, the program outputs th?
final estimate of composition.

Output of various statistics is optional (s22 Section 7,
Pagss 15-17). bropagated errors (imprecision in calculated
amounts, due to impr2cision in m2asur2d intensities for the
unknown) ar? obtained by a common statistical approximation
that uses the sensitivities of each amount to 2ach intensity;
values of these sensitivities (partial G2rivatives) are
obtained by solving differentiated forms of the model
equations.

39


Physical Theories and Fundamental Parameters

Theoretical predictions of intensities use formulas that
have appeared many. times in the literature since the 1920¢s
(see the annotated bibliography, page 28), plus unpublished
modifications by this author.

Homogeneous samples are treated using the formulas of
Gillam and Heal (1952) for the primary and secondary
contributions to intensity.

The incident radiation spectrum is treated by numerical
integration (a composite of trapezoid and Simpson’s rules).

Wavelengths of absorption edges and emission lines are from
the. tabulations of Bearden and Burr (1964-1967).

Photoelectric mass absorption coefficients ar? calculated
from the parametric representations of McMaster et al.

Fluorescence yie2lds (considering the effects of Aug2r and
Coster-Kronig transitions) are Calculated from th2 equations
and data in Bambynek et al. (1972).

Sample-thickness corrections use Compton’s (1929) formula.

Separate particles that do not shadow each other are handled
by the formulas of Criss (1976).

Bulk particulate samples ar? tr2ated using formulas like
those for the homogen2ous cas?, xcept that "effective"
absorption coefficients account for overall effects of
heterogensity on x-ray transport, as in Brown, Criss, and
Birks (1976), and adjustments are mad2 for fluorescence
emission from individual particles, as in Criss (1976).

Program-calculated X-ray tub? spectra use the Kramers law
(1923) for. the generated continuum, and modifications of th?
©*xpressions of Green and Cosslett (1961) for the generated
line intensities (including an approximate treatment of
fluorescenc? by the continuum). The spectrum as gen 2rat 2d
is adjusted for absorption in the anode using the expression
of Philibert (1963), as modified by Duncumb and Shields
(1966) and Heinrich (1970). In addition, the spectrum is
adjusted to account for absorption in the x-ray tub? window
(and in any filter or air-path from the tub2 to th2 sample).
These calculations agr2¢ surprisingly well with measurements,
especially for the purpose of x-ray fluorescence analysis.

Tabulated x-ray tube spectra are from Gilfrich 2t al. and
Brown et al. (1971-1975).

41


RUNNING COMMON P.ROBLEMS

1. Input Style

A simple command may be issued by inputting a keyword.
_During interactive runs, the program will print the
prompting-character "*" when it is ready for input. Two
examples of simple commands ar?

* HELP (causes the program to list all keywords)

* QIT (causes the program to terminate)

Data-.are input by groups. Each. group is introduced by a
keyword, such as COMPOSITION, that announces to the program
what sart of information follows. For example, to input th?
composition of a standard reference material with the
arbitrary name SRM1102, one might. use the data group

* COMPOSITION SRM1102
* CU 72.9
* ZN 27.1
*

The separate data items ar? input in a specific format for
each keyword, as described throughout this manual, and
summarized in Appendix A.

The important characteristics of the input formats includ?
(1) what data follow the keyword on the same card (or
card-image, as for a line of input at an interactive
terminal), (2) what data app%ar on subsequent "cards" in the
same group, (3) the order of data on each card, (4) how th?
group is terminated (usually with blank input), and (5) what
data may be omitted, so that the program will use default
values —- either initial values in the prooram, or
previously-input data of the same nature.

Only the first three 12tters of a keyword are required --
e.ge, one may us? "COM" or COMP" instead of "COMPOSITION".
There are very few restrictions on the spacing of data (i.e.
card-column positions). It is sufficient to separate data by
one or more blanks and/or commas. This free-field style of
input is built into the program, and so does not depend on
what compiler or computer is used.

Tne data groups may be input in practically any ord@r, just

so the necessary information has been input before one calls
for calculations. Data may be changed by repeating a groupb.