Skip to content

Library input reference ​

The sections below are read by the ADAM library itself, so every application built on it (FLUME, PRISM) reads them the same way. Each application adds its own sections: FLUME input reference, PRISM input reference. Where the two applications use a library key differently, the Used column says so.

Parsing rules ​

The input is an INI file read by FiNeR:

  • Section and key names are case-sensitive: CFL, not cfl; [IO], not [io]. When a key or section is duplicated, the first occurrence wins.
  • Comments. A line whose first non-blank character is ;, # or ! is a comment. After a value, only ; starts an inline comment.
  • Missing key, or a value that does not convert. FiNeR returns an error code and leaves the variable untouched, both when the key is absent and when its value does not convert to the key's type (a non-numeric value for a number, finer_option_t.F90). Most readers then stop the run (failed to load [section].(key)); the readers that ignore the error are marked no check below, and the variable keeps its declared default, or stays undefined when it has none. Integers are accepted for reals (1 is a valid real).
  • Logical keys. FiNeR reads the value when its first character is one of .tTfF (.true., T, true, .false., ...); any other value (yes, 1) is a conversion error, as above.
  • CRLF files (Windows line endings) read as LF ones on every compiler: FiNeR drops every CR before splitting the file into lines (FiNeR c55f8d3). Before that fix, nvfortran kept the CR at the end of every value and every FNL build stopped on a CRLF input at its first numeric key; a dependency fetched before 2026-10-26 needs fobis fetch --update.
  • Removed keys. FiNeR ignores keys nobody reads, so a removed key is not an error by itself. The lint src/tests/lint/check-removed-input-keys.sh (run at the top of the PRISM and FLUME regression sweeps) rejects, in the committed PRISM, FLUME and AMR test inputs: [fWLayer] C (replaced by width), [PIC] elliptic_correction (removed in #84 E3d; .true. stops the run) and the whole [linear-algebra] section (removed in #84 E4 with the legacy elliptic smoothers it configured).

Legend for the tables ​

  • Req.: yes means a missing key stops the run. cond. means it is required only under the stated condition. no means optional (the default applies). no check means the error is ignored; see the notes for what happens.
  • Used: who depends on the value. both, FLUME, PRISM, or neither (the key is read, so it must usually be present, but no application uses it).

[IO] ​

io_object%load_from_file. Each application adds keys of its own to this section: FLUME save_auxiliary_fields, PRISM save_fields.

KeyTypeReq.DefaultAccepted / invalidUsedMeaning
output_basenamestringyes—any path prefixbothPrefix of every output file (fields, histories, slices).
it_saveintyes—<= 0 disables field savesbothField (XH5F) save cadence in steps.
restartlogicalyes—logicalboth.true.: skip the initial conditions and load the restart_basename restart files.
restart_basenamestringyes (even when restart = .false.)—path prefixbothBasename of the restart files, read and written.
restart_saveintyes—<= 0 disablesbothRestart save cadence in steps.
residuals_saveintyes—<= 0 disablesbothResidual L2-norm history cadence (<output_basename>-residuals.dat).
divergence_history_saveintno10no checkneitherRead, never used: PRISM writes its divergence history at every diagnostic step, FLUME has its own cadence ([diagnostics]).
save_memory_statuslogicalyes—logicalPRISMPrint the memory status at the diagnostic steps.
save_residual_fieldslogicalyes—logicalbothAlso write the residuals dq_* into the field files.
save_curl_fieldslogicalyes—logicalPRISMAlso write the curl fields.
save_divergence_fieldslogicalyes—logicalPRISMAlso write the divergence fields.
save_gradient_fieldslogicalyes—logicalneitherRead, never used.
save_laplacian_fieldslogicalyes—logicalneitherRead, never used.
seam_divB_tolrealno-1 (off)no checkPRISM2:1 seam div(B) monitor: warn (or stop, below) when the seam max|div B| exceeds it on an AMR run (#29). FLUME uses [mhd] divb_tol.
seam_divB_errorlogicalno.false.no checkPRISM.true.: the seam monitor stops the run instead of warning.

Output files. The library writes the fields as one <output_basename>-<it:9 digits>-procNNNNNN.h5 per rank plus one .xdmf (XH5F, ghost cells included), the restart files as <restart_basename>.time, .tnd and -procNNNNNN.fbd, and the slices as raw MPI-IO .mat files. There is no output-format key.


[grid] ​

grid_object%load_from_ini_file. Every key is required.

KeyTypeReq.Accepted / checksUsedMeaning
ni, nj, nkintyesno check of >= 1. The applications add parity and width rules for AMR (see their pages).bothCells per block along i, j, k, ghost cells excluded.
ngcintyeseach application checks it against its stencils: >= [weno] S, >= fdv_order/2, and more (see their pages)bothGhost cells per side.
emin_x, emin_y, emin_zrealyesno checkbothDomain minimum corner. Divided by L0 in a PRISM non-dimensional model.
emax_x, emax_y, emax_zrealyesno check (emax > emin is not validated)bothDomain maximum corner.
null_x, null_y, null_zlogicalyeslogicalbothNull (inactive) direction: excluded from the fluxes and the time step.

[amr] ​

Read in four places: the grid reads ratio, the tree the refinement shape, adam_object the seam fills, amr_object the cadence and the markers.

KeyTypeReq.DefaultAccepted / invalidUsedMeaning
ratiointno check (effectively required)declared 8, not applied2 (binary), 4 (quadtree), 8 (octree). Any other value leaves the block sizes undefined, with no error.bothRefinement ratio of the tree.
max_levelintno checkdeclared 12, not appliedRefinements beyond it are cancelled silently.bothMaximum refinement level.
iu_ref_levelsintno checkdeclared -1, not applied<= 0: nonebothUniform refinement levels applied at initialisation, before the initial conditions. The blocks are spread over the ranks by whole sibling families (ratio blocks each), so a grid with fewer families than ranks leaves ranks with no block; supported, but the empty ranks do no work.
i_prune, j_prune, k_prune, l_pruneintno checkdeclared -1, not appliedsee the notes belowbothPruning of a "simple initial forest". No application calls prune, but the values enter the neighbour/boundary search: if all four are >= 0 the tree sizes its search box 2**(l-l_prune)*(ijk_prune+1). Keep at least one negative (all four -1 is safest; 0, 0, 0, -1 is equivalent).
frequencyintyes100>= 0FLUMERuntime regrid cadence (#74): 0 no runtime regridding, n > 0 regrid after every n-th step. PRISM reads it and refines at initialization only.
itersintyes5anybothMaximum marker sweeps per AMR update (it stops early when the grid is stable); a sweep refines or coarsens one level.
markers_numberintyes0>= 0bothNumber of [amr_marker_N] sections.
regrid_prolongationstringnolinear (FLUME: conservative)linear, conservative, conservative-state; any other value is fatalFLUMEHow a refined block's children are filled from the parent at a runtime regrid; FLUME's input reference describes the three.
seam_ghost_fillstringnotricubicinjection, restriction-compatible, tricubic, quintic, weno6, quintic-mp; any other value is fatal. The 6-point fills (quintic, weno6, quintic-mp) need at least 6 cells per refined axis in every block (fatal otherwise); on a coupling = refined forest seam both realms must declare the same value.bothCoarse-to-fine ghost fill at 2:1 AMR seams (#68 D1, D2). tricubic: the tensor 4-point Lagrange interpolation, exact for per-direction degree 3. quintic: the 6-point one, exact for degree 5. weno6: a WENO-Z combination of the cubics of the 4-point sub-stencils, dropping those that hold a jump. quintic-mp: the quintic clamped to a monotonicity-preserving bound. With every regime, an app that sets maps%seam_density_var (FLUME) has the density and the velocity of a fine ghost clamped to a monotonicity-preserving bound of the coarse cells around it, and a ghost whose clamped density is below 0.1 times its coarse cell's take that cell's state (#101).
seam_restrictionstringnomeanmean, lagrange6, weno6; any other value is fatal. lagrange6 and weno6 need at least 6 cells per refined axis in every block (fatal otherwise); on a coupling = refined forest seam both realms must declare the same value.bothFine-to-coarse ghost fill at 2:1 AMR seams (#68 C1–C3). mean: the mean of the fine cells, second order. lagrange6: the tensor 6-point Lagrange interpolation to the coarse centre, exact for degree 5. weno6: a WENO-Z combination of the 4-point cubics, falling back to the mean across a jump.

Trap: the tree reader passes one buffer to every key and ignores the error. A missing key therefore takes the value of the key read just before it: a missing max_level becomes equal to ratio, and a missing ratio is garbage. The declared defaults never take effect. Always write all seven tree keys.

When the markers act. At initialization, during the [initial_conditions] amr_iterations passes (each pass sets the initial condition and runs one AMR update of up to iters sweeps), in both applications; in FLUME also at the runtime regrids (frequency > 0).

[amr_marker_N] (N = 1..markers_number) ​

amr_object%load_from_file reads the keys a mode needs; the applications implement different modes.

ModeFLUMEPRISM
1 geometric (AMR_GEO)solid and primitive-box; stl fatalprimitive-box; solid does nothing; stl fatal
2 gradient (AMR_GRAD)yesdoes nothing (the branch is empty)
3 total variation (AMR_TV)fatal at initialisation ("not implemented in FLUME")yes: the total variation of the coils' current density
4 Löhner (AMR_LOHNER)yes, at runtime regrids only (it reads ghost cells the initial AMR does not fill)does nothing (no branch)
5 Jeans length (AMR_JEANS)yes, needs [gravity] self_gravity = .true.does nothing (no branch)
6 registered criterion (AMR_USER)yes, at runtime regrids only: the criterion the program registered under name (#110); an unregistered name is fatal at the first regriddoes nothing (no branch)

An unknown mode reads no further keys and stops nothing in the library; FLUME stops on it at the first AMR pass.

KeyTypeReq.Accepted / invalidModesMeaning
modeintyessee the table aboveallMarker kind.
delta_typestringyes (all modes)x, y, z, max (the maximum over the active directions); other values are fatal at marking in FLUME, and in PRISM's mode-3 marker leave the compared spacing undefined (no check)1 (solid), 2, 3, 5Which block spacing is compared with delta_fine/delta_coarse.
delta_finerealyes (all modes)no check1 (solid), 2, 3Admissible spacing where the criterion fires.
delta_coarserealyes (all modes)no check1 (solid), 2, 3Admissible spacing elsewhere.
geo_typestringmode 1solid, primitive-box, stl; other values are fatal at load1Geometric marker kind.
solidintmode 1 + solid1..[solids] number, otherwise fatal at marking1Refine the blocks crossed by that solid's surface.
box_xmin, box_ymin, box_zmin, box_xmax, box_ymax, box_zmaxrealmode 1 + primitive-boxno check1Box: the blocks whose centroid lies inside it are refined.
target_levelintmode 1 + primitive-boxno check (capped by max_level)1Refine the in-box blocks until they reach this level.
stl_filenamestringmode 1 + stl—1STL surface (both applications refuse stl).
fieldintmodes 2, 3, 41 = conservative state, 2 = auxiliary fields; other values are fatal at marking2, 4Array holding the marker variable (PRISM's mode 3 reads it, unused).
varintmodes 2, 3, 4a variable index of that array, otherwise fatal at marking2, 4Marker variable.
tolrealmodes 2, 3no check2, 3Threshold: the gradient magnitude (mode 2) or the total variation (mode 3) above which the block gets delta_fine.
refine_tol, derefine_tolrealmode 40 <= derefine_tol < refine_tol <= 1, otherwise fatal4Löhner thresholds: refine above refine_tol, coarsen below derefine_tol, keep between.
epsilonrealno (mode 4)>= 0, default 0.014Noise filter relative to the variable.
floorrealno (mode 4)>= 0, default 04Absolute noise filter, for a variable that vanishes in quiet regions.
bufferintno (mode 4)>= 0, default 1 (FLUME: also <= ngc - 1)4Ghost layers the estimator reads.
jeans_cellsrealno (mode 5)> 0, default 85Refine where some interior cell resolves its Jeans length with fewer cells.
namestringmode 6the name a criterion was registered under; empty is fatal at load, unregistered at initialisation6The registered criterion (adam_amr_criterion_object).
jeans_cells_derefinerealno (mode 5)> jeans_cells, default 2 * jeans_cells; otherwise fatal5Coarsen where every interior cell has more cells per Jeans length; keep between.

FLUME's page lists its variable indices and the runtime AMR setup.


[field] ​

KeyTypeReq.UsedMeaning
nvintnot readneitherBoth applications pass nv from their physics, so field_object never reads this key; it can be omitted.

[runge_kutta] ​

rk_object%load_from_file; each application also reads scheme first, to size the per-block memory budget.

KeyTypeReq.Accepted / invalidUsedMeaning
schemestringyessee the table below; an unknown name is fatalbothTime integrator. It also sizes the per-block memory budget (stage fields).
NameKindStored stage fieldsFLUMEPRISM
runge-kutta-1low-storage, forward Euler1acceptedEM: accepted; PIC, PML, 2:1 faces: refused
runge-kutta-2low-storage TVD, 2nd order1acceptedas above
runge-kutta-3low-storage TVD, 3rd order1acceptedas above
runge-kutta-ssp-11SSP, forward Euler1acceptedEM and PML: accepted; PIC: refused
runge-kutta-ssp-22SSP, 2nd order2acceptedaccepted
runge-kutta-ssp-33SSP, 3rd order3acceptedaccepted
runge-kutta-ssp-54SSP, 5 stages, 4th order5acceptedaccepted
runge-kutta-yoshidasymplectic, 4th order, 4 stages0refusedEM on CPU: accepted; FNL, PIC, PML, 2:1 faces: refused

The staged path of the forest (any 2:1 AMR face, any multi-realm forest) needs an SSP scheme in both applications. In a forest manifest, seams with coupling_cadence = stage_coincident require both realms to use the same scheme (fatal otherwise).


[weno] ​

weno_object%load_from_file. FLUME reconstructs with it always; PRISM only with [numerics] scheme_space = weno, a CPU path (the FNL backend refuses it).

KeyTypeReq.DefaultAccepted / invalidUsedMeaning
schemestringyes—see the table below; an unknown name is fatalbothWENO order (stencil half-width S). ngc >= S is checked by FLUME always, by PRISM with scheme_space = weno.
weightsstringnojsjs (Jiang–Shu, absolute ε), si (scale-invariant); an unknown value is fatalbothNonlinear weights (PRISM uses them with scheme_space = weno).
ror_numberintyes0>= 0neitherNumber of order-reduction (ROR) stages. S always comes from scheme: initialize sets it after reading the ROR keys.
ror_scheme_1 … ror_scheme_<ror_number>intcond. (ror_number > 0)——neitherROR stencil sizes.
ror_thresholdrealyes0.9—neitherROR trigger.
ror_vars_numberintyes2>= 0neitherNumber of ROR check variables.
ror_ivar_1 … ror_ivar_<ror_vars_number>intcond. (ror_vars_number > 0)——neitherROR check variables.
enable_ror_statslogicalyes.false.logicalneither (.true. allocates an nb x cells x 3 integer array)ROR statistics.
ib_reduction_extentintyes0—neitherOrder reduction near immersed solids.
ib_reduced_orderintyes1—neitherReduced S near solids.
NameSOrderKind
weno-u-1, weno-u-3, weno-u-5, weno-u-7, weno-u-91–51, 3, 5, 7, 9upwind
weno-c-2, weno-c-4, weno-c-6, weno-c-81–42, 4, 6, 8centred (FLUME refuses them)

[fdv] ​

realm_object reads it: the finite-difference/finite-volume operators (gradient, divergence, curl, Laplacian) of adam_fdv_operators_library.

KeyTypeReq.Accepted / invalidUsedMeaning
fdv_schemestringyesFD/fd/Fd/fD or FV/fv/Fv/fV; other values are fatalPRISMOperator family. PRISM's curl, divergence and coil stamping follow it; FLUME's div(B) diagnostic is always centred FD.
fdv_orderintyeseven, 2 to 10 (half-stencil fdv_order/2 <= 5); no range check at load. PRISM checks fdv_order/2 <= ngc at initialization; FLUME checks it (and <= 3 on FNL) at the first div(B) diagnostic of an MHD run.bothOrder of the centred operators. PRISM: its whole spatial operator and the t0 elliptic solves (which accept 2, 4, 6, 8: an order 10 stops at the first solve). FLUME: the div(B) diagnostic of MHD runs only.

[solids] and [solid_N] ​

ib_object: analytical immersed solids. FLUME applies them (Euler only); PRISM loads them and passes their distance function to its Runge-Kutta stages, and no committed PRISM input uses them.

[solids] ​

KeyTypeReq.DefaultMeaning
numberintyes0Number of [solid_N] sections. 0: no immersed boundary.
n_eikonalintyes2Eikonal extrapolation sweeps per residual evaluation, filling the solid cells.

[solid_N] (N = 1..number) ​

KeyTypeReq.Accepted / invalidMeaning
namestringyesanyLabel (printed only).
bc_typeintyes1 viscous (all momentum negated inside the solid), 2 inviscid (normal momentum reflected); any other value applies no inversion, silentlyWall treatment of the solid-cell state.
definitionstringyesanalytical_sphere, analytical_circle, analytical_rectangle; any other value (file.off included, never implemented) is fatal at loadGeometry kind.
sphere_center_x, sphere_center_y, sphere_center_z, sphere_radiusrealanalytical_sphereno checkSphere.
circle_center_x, circle_center_y, circle_center_z, circle_radiusrealanalytical_circleno checkInfinite cylinder.
circle_axischaranalytical_circlex, y, z; other values are fatal at loadCylinder axis.
rectangle_center_x, rectangle_center_y, rectangle_center_z, rectangle_edge_1, rectangle_edge_2realanalytical_rectangleno checkInfinite rectangular prism.
rectangle_axischaranalytical_rectanglex, y, z; other values are fatal at loadPrism axis.

[slices] and [slice_N] ​

slices_object: the state sampled on a lattice of points and written as raw MPI-IO .mat files, <output_basename>-slice_NN-<it:9>.mat. Both applications write them.

[slices] ​

KeyTypeReq.Accepted / invalidMeaning
slices_numberintyes>= 0, negative is fatalNumber of [slice_N] sections. 0: no slices.

[slice_N] (N = 1..slices_number) ​

Every key is required (fatal when missing) and checked at initialization.

KeyTypeAccepted / invalidMeaning
itypestringtrilinear, inverse_distance; other values are fatalInterpolation from the cells to the slice points.
n_saveint>= 1; 0 or negative is fatalSave cadence in steps; the last step is also saved.
ni, nj, nkint>= 1, otherwise fatalPoints of the lattice, cell-centred on the box.
emin_x, emin_y, emin_z, emax_x, emax_y, emax_zrealemin <= emax, and every point inside the realm's domain, otherwise fatalBox sampled by the lattice, in the grid's units (divided by L0 in a PRISM non-dimensional model).

Forest manifest (multi-realm) ​

adam_forest_manifest reads it, for both applications: a separate INI whose [realm.N] entries point at full realm inputs (each with the sections above and the application's own). If the file passed to the executable has a [forest] section with realms_number >= 1, it is a manifest; otherwise it is itself a single-realm input. Manifest errors use Fortran error stop, not the library's error_stop.

SectionKeyTypeReq.Accepted / invalidMeaning
[forest]realms_numberintyes>= 1, otherwise fatal. Its presence with >= 1 makes the file a manifest.Number of realms.
[realm.N] (N = 1..realms_number)inistring (≤ 256 chars)yesused verbatim: it resolves against the process working directory, not the manifest's directoryRealm input.
[forest.topology]inter_realm_faces_numberintnodefault 0 (no coupling)Number of glued faces.
[forest.topology.face_N]realm_a, realm_bintyes1..realms_number, otherwise fatalRealms on each side of the seam.
face_a, face_bstringyes+x -x +y -y +z -z, also upper case and the suffix forms x+, X-, …; other values are fatalGlued faces.
couplingstringnomirror (default), refined, auto, periodic, interpolate (lower, Capitalised or UPPER case); other values are fatal. periodic and interpolate are reserved: the forest stops at setup on them.mirror joins seam cells of the same size (fatal otherwise). refined joins a 2:1 jump (#52): the seam cells must differ by exactly 2 along every axis the trees refine and be equal along a null one (a quadtree's z), both realms of the same tree kind ([amr] ratio), the seam normal to a refined axis (#71). auto (#110) is decided at every topology build: either of the two when each side holds one cell size, else face by face (mixed levels along the seam: each face joins equal cells or a 2:1 jump, either realm the fine one), so runtime AMR may change it; it requires, whatever side is fine, the same block cell counts along the seam, the same seam_ghost_fill and seam_restriction, and even block cell counts along the refined axes in both realms (a pair that turns 2:1 also needs the refined conditions). With runtime AMR the forest keeps the seam cells equal (mirror), at the declared 2:1 jump (refined), one level per side for both, or, for auto, face by face equal or in a ratio of 2 between neighbouring leaves (edges and corners included): cell sizes, not levels, since each realm counts levels from its own root.
coupling_cadencestringnoend_of_step (default, α) or stage_coincident (β), in the same three case forms; other values are fatal. β requires both realms to have equal [runge_kutta] scheme, equal nv and equal stages per step (fatal otherwise). Conflicting cadences between the same realm pair are fatal.Seam fill once per step (α) or at every Runge-Kutta stage (β). A 1:1 same-resolution seam needs β to stay divergence-free (#31).

The forest concepts and the forest cookbook describe the multi-realm machinery.