← Modern Nuclear Data Processing · Learning AMPX by example

Learning AMPX · step 2

A continuous-energy library with AMPX, step by step

From one ENDF/B-VIII.1 evaluation to a SCALE continuous-energy nuclide file (the HDF5 format of SCALE 6.3/7), one module at a time. It starts with a complete input that runs in a minute and builds up to what the library run uses for every nuclide: 15 temperatures, probability tables, DBRC data and thermal scattering.

Most of this work, including this page, was generated with AI (Claude, Anthropic) under the direction of Ian H; it has not been independently reviewed. Every input on this page is quoted unchanged from the project's files; times and sizes are from its run outputs and work log.

Data ENDF/B-VIII.1 Inputs written by ce_chain.py Machine laptop, 15.7 GB RAM Updated 21 October 2026

The first input: B-11 at one temperature

Every input of the library is written by a script, ce_chain.py, from a few facts about the evaluation. For B-11 at 293.6 K with free-gas thermal scattering they are: ENDF MAT 528, SCALE ID 5011, atomic weight ratio 10.9147 and potential scattering cross section 5.03432 b. The input below is the one it wrote, unchanged. It ran in 58 seconds and ends in a SCALE nuclide file.

b11_293.inpwritten by ce_chain.py · paths of the processing machine
' b11_293: SCALE CE nuclide 5011 from ENDF/B-VIII.1 MAT 528, AMPX, eps 0.001, kinematics 0.01, JAMAICAN 0.001
' temperatures (K): 293.6
' thermal: free gas
=shell
ln -sf /home/hardtohit10/ENDF-B-VIII.1/neutrons-version.VIII.1/n-005_B_011.endf ft11f001
ln -sf /home/hardtohit10/ENDF-B-VIII.1/neutrons-version.VIII.1/n-005_B_011.endf ft12f001
mkdir -p kin/fast
end
=polident_new
out=ft31f001 abbrev=ft32f001 globalendf=ft11f001 globalformat=endf
globaleps=0.001
nuc={ mat=528 }
end
=broaden
input=31 output=36 eps=0.001 t=293.6
end
' fast kinematics, outgoing neutrons only; id=1 is the incident-particle ZA
=y12
eps=0.01 ndf=12 kin=35 mat=528 id=1 zap=1.0 awp=1.0 for=tab
end
=jamaican_new
mon=35 out=45 result=native equi=false eps=0.001
end
=shell
mv ft45f001.h5 ft45f001 kin/fast/ && rm -f ft35f001
end
=shell
mkdir -p kin/t00
end
=y12
free awr=10.9147 pot=5.03432 temp=293.6
eps=0.001 kin=34 id=1 for=tab point=38
end
=shell
rm -f ft34f001 && mv ft38f001 ft50f001
end
=y12
free awr=10.9147 pot=5.03432 temp=293.6
eps=0.01 kin=37 id=1 for=tab
end
=jamaican_new
mon=37 out=47 result=native equi=false eps=0.001
end
=shell
mv ft47f001.h5 ft47f001 kin/t00/ && rm -f ft37f001
end
' merge the 1-D thermal cross sections, relabel MAT 1 -> MAT, merge with the broadened data
=zest
0$$ 39 0  1$$ 1 t
2$$ 50 0 t
end
=tomato
0$$ 39 40  1$$ 1 0 0 t
2$$ 1  3$$ 528 t
end
=zest
0$$ 41 0  1$$ 2 t
2$$ 36 0 t
2$$ 40 0 t
end
=platinum_new
particle=neutron
zaid=5011
title="b11_293 528 5011 ENDF/B-VIII.1 AMPX CE eps 0.001 kin 0.01 jam 0.001"
info={file=ft32f001 id=528}
cross={file=ft41f001 id=528}
kinematics=["kin/fast/ft45f001.h5" "kin/t00/ft47f001.h5"]
sigp=5.03432
fileid="n_0005011"
end
=shell
mkdir -p /home/hardtohit10/ampx-ce/mev20/b11
cp -r n_0005011* /home/hardtohit10/ampx-ce/mev20/b11/
cp ft32f001 /home/hardtohit10/ampx-ce/mev20/b11/info.tab1; cp ft36f001 /home/hardtohit10/ampx-ce/mev20/b11/broadened.tab1; cp ft41f001 /home/hardtohit10/ampx-ce/mev20/b11/cross.tab1
du -sk kin/* > /home/hardtohit10/ampx-ce/mev20/b11/kin_sizes.txt
end

What each block did in that run (CPU time from the run's output):

ModuleJobCPU sWrites
polident_new0 K point cross sections: resonances reconstructed and added to the File 3 data0.05ft31f001 (0 K), ft32f001 (the abbreviated "info" file PLATINUM needs)
broadenDoppler broadening to 293.6 K0.08ft36f001
y12fast secondary distributions, tabulated (eps 1e-2), outgoing neutrons only2.76ft35f001
jamaican_newconverts them to the sampling form, in HDF52.02kin/fast/, 43.9 MB
y12 point=free-gas thermal cross section at eps 1e-3; its distributions are deleted50.3ft50f001
y12free-gas distributions at eps 1e-21.97ft37f001
jamaican_newthermal distributions to the sampling form0.78kin/t00/, 17.8 MB
zest · tomato · zestmerge the thermal cross sections, relabel them from MAT 1 to 528, merge them with the broadened data0.10ft41f001
platinum_newassembles the nuclide file0.20n_0005011.h5 (6.6 kB) and n_0005011/moderator_5011.h5 (61.7 MB)
The output is a file and a directory

PLATINUM (like jamaican_new) writes a small index file with HDF5 external links, n_0005011.h5, and the data in a directory beside it. Copy both (cp -r n_0005011*, last block) or the index points at nothing. The data file is called moderator_… when the nuclide has thermal distributions.

Warnings in a normal run

This run finished with exit code 0 and still printed warnings: PLATINUM cannot check that HDF5 kinematics files exist; it set the thermal cutoff to its default of 10 eV because the input gives none; and it moved the lower energy of the inelastic levels MT 51–60 slightly (2.32167 to 2.31935 MeV for MT 51). The library's B-11 file, made the same way at 15 temperatures, loads in SCALE's data loader without corrector warnings.

1 POLIDENT: 0 K point data

When the tolerance does nothing

For U-238 the POLIDENT output was byte for byte the same at 1e-3 and 1e-4. Its ENDF/B-VIII.1 resonance data are in the R-matrix limited format (LRF=7), which POLIDENT reconstructs on its own grid. For multilevel Breit-Wigner and Reich-Moore (LRF=3) evaluations the tolerance does apply.

2 BROADEN: one temperature at a time

With several temperatures, broaden each one directly from the 0 K file and merge the results. This is the start of U-238's input, at its first two temperatures:

u238.inplines 14–31 of 607
=broaden
input=31 output=36 eps=0.001 t=293.6
end
=broaden
input=31 output=70 eps=0.001 t=350
end
=pickeze
0$$ 70 72  1$$ 0 0 0 1 0 1 0 t
5** 350 t
end
=zest
0$$ 71 0  1$$ 2 t
2$$ 36 0 t
2$$ 72 0 t
end
=shell
mv ft71f001 ft36f001 && rm -f ft70f001 ft72f001
end
Do not give BROADEN a list of temperatures

It broadens each temperature from the previous one and the error adds up. O-16 capture at 0.0253 eV, a 1/v cross section that broadening must leave unchanged:

Broadened600 K2500 K
in sequence, 15 temperatures in one call+0.25 %+0.50 %
each directly from 0 K+0.002 %+0.012 %

Broadened from 0 K, O-16 elastic at 0.0253 eV is 4.03836 b at 600 K and 4.79807 b at 2500 K, against NJOY's 4.0385 and 4.7983 b.

Between BROADEN at 1e-3 and at 1e-4, U-238 differed by about 0.01 % in resonance integrals and about 0.15 % in group averages (0.5 % in one sub-threshold fission group), and the 1e-4 files had 3–4 times the points. That is why 1e-3 was kept for the cross sections.

3 PURM and PURM_UP: probability tables

Only for evaluations with an unresolved resonance range. PURM samples resonance ladders at every temperature; PURM_UP adds the smooth File 3 background and writes the tables PLATINUM reads (351 evaluations of the library plan have an unresolved range).

u238.inplines 227–243
' unresolved-resonance probability tables
=purm
logp=46 bond=49
nuc
nbatch=300 iter=600 nband=20 mat=9237 ndfb=11
temp=293.6 350 400 450 500 550 600 700 800 900 1000 1200 1500 1800 2500
enuc
end
=shell
mkdir -p /home/hardtohit10/ampx-ce/runs/u238/keep && cp ft46f001 /home/hardtohit10/ampx-ce/runs/u238/keep/
end
=purm_up
in=46 out=48 ndfb=11 matf=9237 matp=92238 eps=0.001
end
=shell
cp ft48f001 /home/hardtohit10/ampx-ce/runs/u238/keep/ && test -s ft48f001 || echo 'ERROR: PURM_UP wrote no probability tables'
end
matp is the ENDF ZA, not the MAT or the SCALE ID

PURM labels its tables with the ZA of the ENDF file. With matp set to the MAT, PURM_UP wrote an empty file and PLATINUM stopped after 98 hours of PURM (U-238). With the SCALE ID of a metastable nuclide (Am-242m: 1095242 instead of 95242) the same happened after 35 hours. PLATINUM's ptable={file= id=} takes the same ZA. matf stays the MAT.

Time14–26 min per energy for all 15 temperatures (actinides measured); U-238 about 26 h in all
Memoryabout 0.2 GB; PURM is where most jobs spend most of their time
Keepcopy ft46f001 and ft48f001 out at once: a failure later in the run then costs minutes, not days

One evaluation could not be sampled: Na-22, whose File 3 background is negative at 15 keV (about −0.04 b). It is processed without probability tables. Against NJOY's tables (PURR) the band averages agree within 0.01 % (median) for U-238 elastic and capture; see the comparisons.

4 DBRC data: the 0 K elastic cross section

For the Doppler broadening rejection correction PLATINUM needs the 0 K elastic cross section in the nuclide file. PICKEZE takes MT 2 from POLIDENT's output:

u238.inplines 244–251
' DBRC: 0 K elastic (MT 2) from the POLIDENT output
=pickeze
0$$ 31 74  1$$ 0 0 1 0 0 0 0 t
4$$ 2 t
end
=shell
mkdir -p /home/hardtohit10/ampx-ce/runs/u238/keep && cp ft74f001 /home/hardtohit10/ampx-ce/runs/u238/keep/ && test -s ft74f001 || echo 'ERROR: no DBRC data'
end

Here only for U-238 and Pu-239. U-238's DBRC data (632 054 points) differ from OpenMC's 0 K elastic by a median 0.0125 %, with the 1 eV–20 keV integral within 0.001 %.

5 Y12 and JAMAICAN: secondary distributions

Y12 tabulates every angle and energy distribution of the evaluation; jamaican_new turns them into the probability and cumulative distributions SCALE samples. In the B-11 input:

b11_293.inplines 17–26
' fast kinematics, outgoing neutrons only; id=1 is the incident-particle ZA
=y12
eps=0.01 ndf=12 kin=35 mat=528 id=1 zap=1.0 awp=1.0 for=tab
end
=jamaican_new
mon=35 out=45 result=native equi=false eps=0.001
end
=shell
mv ft45f001.h5 ft45f001 kin/fast/ && rm -f ft35f001
end
The tolerance that costs

Y12's eps sets how finely the distributions are tabulated, and with it the time and size of everything after it. H-2's (n,2n) break-up alone has 49 million outgoing-energy points at 1e-3 and 3.9 million at 1e-2; processing the 1e-3 tabulation took about 4.5 hours, against about a minute at 1e-2. Here the distributions use 1e-2 and JAMAICAN 1e-3, while every cross section keeps 1e-3. The precision study

6 Thermal scattering, temperature by temperature

Each temperature gets two Y12 passes: one at the cross-section tolerance with point=, which writes the 1-D thermal cross section (its distributions are deleted at once), and one at the distribution tolerance, followed by JAMAICAN. For a free nuclide (B-11, lines 27–46 of the input above) Y12 uses the free-gas model, free awr= pot= temp=. For a bound moderator it reads S(α,β) from a single-temperature file of the thermal-scattering evaluation; here D in D₂O (MAT 11) at 283.6 K:

d_d2o_e5.inplines 267–287 of 669
=shell
ln -sf /home/hardtohit10/ampx-ce/split/DinD2O/tsl-DinD2O_283.6K.endf ft13f001
mkdir -p kin/t00
end
=y12
ndf=13 mat=11
eps=0.001 kin=34 id=1 for=tab point=38
end
=shell
rm -f ft34f001 && mv ft38f001 ft50f001
end
=y12
ndf=13 mat=11
eps=0.01 kin=37 id=1 for=tab
end
=jamaican_new
mon=37 out=47 result=native equi=false eps=0.001
end
=shell
mv ft47f001.h5 ft47f001 kin/t00/ && rm -f ft37f001
end
d_d2o_e5.inplines 561–568
=shell
ln -sf /home/hardtohit10/ampx-ce/split/DinD2O/tsl-DinD2O_600.0K.endf ft13f001
mkdir -p kin/t14
end
=y12
ndf=13 mat=11
eps=0.0005 kin=34 id=1 for=tab point=38
end
Free gasthe 1e-3 point= pass: 50 s for B-11, about 3 min per temperature in the O-16 test
Bound, 600 KY12 point= at 5e-4: 459 s and 4.59 GB; at 1e-4 or 3e-4 more than 6 GB
Checksfree gas against the exact formula: median 0.016 %; D in D₂O against NJOY up to 573.6 K: median 0.05–0.27 %

Y12 tabulates thermal data up to 5.05 eV, its default emax; the NJOY-processed OpenMC library goes to 10 eV.

7 Merge, then PLATINUM

ZEST collects the 1-D thermal cross sections (one unit per temperature, 50 upwards), TOMATO relabels them from MAT 1 to the evaluation's MAT, and a second ZEST merges them with the broadened data (B-11, lines 47–60). PLATINUM then reads everything. U-238's call shows all the optional inputs:

u238.inplines 590–601
=platinum_new
particle=neutron
zaid=92238
title="u238 9237 92238 ENDF/B-VIII.1 AMPX CE eps 0.001 kin 0.01 jam 0.001"
info={file=ft32f001 id=9237}
cross={file=ft41f001 id=9237}
kinematics=["kin/fast/ft45f001.h5" "kin/t00/ft47f001.h5" "kin/t01/ft47f001.h5" "kin/t02/ft47f001.h5" "kin/t03/ft47f001.h5" "kin/t04/ft47f001.h5" "kin/t05/ft47f001.h5" "kin/t06/ft47f001.h5" "kin/t07/ft47f001.h5" "kin/t08/ft47f001.h5" "kin/t09/ft47f001.h5" "kin/t10/ft47f001.h5" "kin/t11/ft47f001.h5" "kin/t12/ft47f001.h5" "kin/t13/ft47f001.h5" "kin/t14/ft47f001.h5"]
sigp=12.32636
ptable={file=ft48f001 id=92238}
dbrc="ft74f001"
fileid="n_0092238"
end

8 After PLATINUM: compress, index, check

Compress without loss

PLATINUM's files are uncompressed: 0.28–0.46 GB per nuclide at 15 temperatures, about 190 GB for the library. h5repack -f SHUF -f GZIP=4 brought O-16 from 428 to 170 MB; the driver keeps the compressed file only if h5diff finds the contents identical. SCALE's data loader read the compressed O-16 with the same output as the uncompressed file.

One master file

KENO and XSProc open a library by one file name. The public ce_simonize only links photonuclear data into an existing library and cannot merge nuclide files, so a short script (make_master.py) writes the master file directly: the metadata, one nuclide_md table with every nuclide's rows, and one external link per nuclide and temperature. The table must use PLATINUM's exact on-disk compound type; with h5py's own type, SCALE's reader fails with "no conversion path". For 458 nuclides: 6 872 links, 1.2 MB.

Load every file with SCALE's own reader

CELibraryReader, built with AMPX, is the loader KENO and XSProc use. check_ce_load.py runs it on each nuclide with every kind of data switched on, followed by SCALE's corrector (redundant sums, nubar ratios, distribution bounds, probability tables). All 458 files finished by 20 October load at every temperature with no corrector warnings, using 0.3–5.1 GB. This is a load and consistency check, not a transport calculation; a transport test with SCALE 6.0 is being tried.

Compare with NJOY-processed data

verify_xs.py, verify_thermal.py and verify_urr_dbrc.py compare a nuclide file with the official OpenMC ENDF/B-VIII.1 library (made with NJOY from the same evaluations). For O-16, H-2, U-235, U-238 and Am-242m the point cross sections agree to a median 0.02–0.12 %. The full tables are on the progress page.

From one nuclide to 557

The full input for one nuclide is 580–670 lines at 15–17 temperatures, so inputs are generated, never edited. The generator's options:

ce_chain.pyusage, from its docstring
python ce_chain.py NAME --endf FILE --mat MAT --zaid ZAID [--za ZA] --awr AWR --sigp SIGP
                   (--free T1 T2 ... | --tsl SPLITDIR --tsl-mat MAT)
                   [--eps 1e-3] [--kin-eps 1e-2] [--jam-eps 1e-3] [--y12-endf FILE]
                   [--urr] [--dbrc] [--outdir DIR]

A driver, run_library.py, writes each input with it and runs it through run_ampx.sh:

What it costs

NuclideTemperaturesModulesTimeNote
B-11, the example above1171 min11 modules and 6 shell blocks
He-4, the library run's smoke test151579 minno unresolved range
O-1615–about 40 minfirst full run, before per-temperature broadening; 412 MB uncompressed
D in D₂O, with the 5e-4 passes17374about 55 minY12 peaks 4.59–5.00 GB
U-235, probability tables15161about 7 h
U-238, probability tables and DBRC15163about 26 hmost of it in PURM
Zr-9115–61 hrecorded in the work log on 18 October
Wall-clock times on one laptop, often with other jobs running beside them. Before the library run, the whole library was estimated from its number of PURM energies at about 2 200 job-hours.