← Modern Nuclear Data Processing · Learning AMPX by example
Learning AMPX · step 2
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.
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: 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):
| Module | Job | CPU s | Writes |
|---|---|---|---|
| polident_new | 0 K point cross sections: resonances reconstructed and added to the File 3 data | 0.05 | ft31f001 (0 K), ft32f001 (the abbreviated "info" file PLATINUM needs) |
| broaden | Doppler broadening to 293.6 K | 0.08 | ft36f001 |
| y12 | fast secondary distributions, tabulated (eps 1e-2), outgoing neutrons only | 2.76 | ft35f001 |
| jamaican_new | converts them to the sampling form, in HDF5 | 2.02 | kin/fast/, 43.9 MB |
| y12 point= | free-gas thermal cross section at eps 1e-3; its distributions are deleted | 50.3 | ft50f001 |
| y12 | free-gas distributions at eps 1e-2 | 1.97 | ft37f001 |
| jamaican_new | thermal distributions to the sampling form | 0.78 | kin/t00/, 17.8 MB |
| zest · tomato · zest | merge the thermal cross sections, relabel them from MAT 1 to 528, merge them with the broadened data | 0.10 | ft41f001 |
| platinum_new | assembles the nuclide file | 0.20 | n_0005011.h5 (6.6 kB) and n_0005011/moderator_5011.h5 (61.7 MB) |
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.
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.
globaleps is the reconstruction tolerance: 1e-3 here, the AMPX default. globalcombeps was left at its default of 1e-4.abbrev= file (unit 32) holds the evaluation's header data; PLATINUM reads it as info=.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.
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:
=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
5** 350, an exclusive temperature selection), so the temperature-independent functions stored at T = 0 are not copied twice. ZEST merges the result into unit 36.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:
| Broadened | 600 K | 2500 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.
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).
' 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
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.
ft46f001 and ft48f001 out at once: a failure later in the run then costs minutes, not daysOne 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.
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:
' 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 %.
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:
' 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
id=1: jamaican_new expects the kinematics to be labelled with the incident particle (1 = neutron). With id= the MAT it stops with "Invalid ZAI".zap=1.0 awp=1.0: outgoing neutrons only. Without them Y12 also writes outgoing charged particles, whose empty distributions end up as equiprobable bins, which the HDF5 format refuses.equi=false: the same refusal ("Equiprobable exiting energy is no longer supported").ndf=12: Y12 reads unit 12. For B-11 and most nuclides that is the evaluation itself; for U-235, U-238 and Pu-239 it is a copy without MF6 MT18: ENDF/B-VIII.1 added neutron-multiplicity subsections there (LAW −5) that Y12 cannot read, so the fission spectrum comes from MF5 MT18. Every such copy is recorded in modifications.csv. Th-232, Pa-231 and Pa-233, whose MF6 MT18 is LAW 1, need no copy.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
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:
=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
jamaican_new in memory.ce_chain.py --eps-at sets the tolerance of the point= pass at chosen temperatures only. D in D₂O uses 5e-4 at 600, 623.6 and 650 K, where Y12's integration converges slowly:=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
point= pass: 50 s for B-11, about 3 min per temperature in the O-16 testpoint= at 5e-4: 459 s and 4.59 GB; at 1e-4 or 3e-4 more than 6 GBY12 tabulates thermal data up to 5.05 eV, its default emax; the NJOY-processed OpenMC library goes to 10 eV.
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:
=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
sigp=, the potential scattering cross section, was taken from SCALE's standard composition library where it has the nuclide (430 evaluations; U-238 12.32636 b). For 76 others it is 4πAP² from the first resonance range, and for the last 52 the elastic cross section at 0.0253 eV of the OpenMC library. The same value is Y12's pot= for free gas.ptable= takes the ZA (step 3); dbrc= the PICKEZE file (step 4).fileid="n_0092238" names the output; SCALE IDs are Z × 1000 + A, plus 1 000 000 for a metastable state.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.
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.
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.
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.
The full input for one nuclide is 580–670 lines at 15–17 temperatures, so inputs are generated, never edited. The generator's options:
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:
--jobs 10 --min-free-gb 3.5 --vmem-gb 4.5);STOP makes it start nothing new; a file JOBS changes the number of jobs while it runs;status.json and a line in a log; on success the bulky intermediates are deleted and the file is compressed;| Nuclide | Temperatures | Modules | Time | Note |
|---|---|---|---|---|
| B-11, the example above | 1 | 17 | 1 min | 11 modules and 6 shell blocks |
| He-4, the library run's smoke test | 15 | 157 | 9 min | no unresolved range |
| O-16 | 15 | – | about 40 min | first full run, before per-temperature broadening; 412 MB uncompressed |
| D in D₂O, with the 5e-4 passes | 17 | 374 | about 55 min | Y12 peaks 4.59–5.00 GB |
| U-235, probability tables | 15 | 161 | about 7 h | |
| U-238, probability tables and DBRC | 15 | 163 | about 26 h | most of it in PURM |
| Zr-91 | 15 | – | 61 h | recorded in the work log on 18 October |