Project

EarthSciIntegrator

One specification for integrating EarthSciML models — explicit, implicit and IMEX methods, operator splitting, a planner, and discrete adjoints — implemented natively in Julia and Rust and checked against each other.

Contents

The run configuration

Status: M0 draft, 2026-10-23; M2 additions 2026-10-25 (axes, §6.1; time origin, §1.1; selector attribution, §3.1; refusal codes, §8); M3 additions 2026-11-24 (dt_scope restored, leaf partition keys lanes and reshard, rule 19; spec/partitioning.md). Normative for both implementations (D1, D8). The structure is fixed by schemas/run-config.schema.json ; this chapter gives the meaning, and the rules a schema cannot check (§8). Background is in architecture §3–§5 and decisions D2, D21, D24.

A run configuration says how to integrate one .esm model: how its right-hand side is split into operators, how the operators are scheduled and with which methods, how the macro step is chosen, how the domain is partitioned, at what precision each part runs, and what the adjoint differentiates. The .esm stays free of algorithm names (D2).

1. The document

  • A run config is a JSON document (D24) that validates against the schema for its esm_integrator version.
  • esm_integrator is the version of this spec, independent of the esm format version. An implementation refuses a version it does not implement.
  • model is the path of the .esm document, resolved relative to the run config’s own location. In conformance cases only, toy:<problem> names a hand-written toy problem instead (spec/toy-problems.md §2).
  • Precedence (architecture §3.1). The run config’s model is authoritative for a run. If the .esm also carries solver.external (U1), the two must name each other, or the planner refuses. The planner never writes solver.external into derived documents. Solver hints on mounted component files are dropped at assembly (U1), so per-component tolerances are restated here.
  • time is the run interval (§1.1).
  • Unknown keys are errors at every level. There is no extension mechanism in 0.1.0.

1.1 The run interval: time

A run integrates over an interval $[t_0, t_f]$. Three sources may give it. In order of preference (D60):

  1. The caller: an argument of the API call that plans or runs the model, or a command-line option of a tool that does.
  2. The run config: time.
  3. The model: the .esm document’s solver.time_span (U16, in EarthSciAST 0.4.0 and esm 1.3.0; esm-spec §2.2.7), read with EarthSciAST’s resolve_time_span.

The most preferred source that gives an interval gives all of it; start and end are never taken from different sources. If none gives one, the planner refuses (§8 rule 14).

time is {"start": T, "end": T} or {"start": T, "duration": D}. D is a number of seconds or a "<number> <unit>" string (§2.2), but not a parameter name: the interval is fixed when the plan is made, and a parameter can be overridden or differentiated later. T is a time, either:

  • a number of seconds of model time; or
  • an RFC 3339 timestamp in UTC ("2019-07-01T00:00:00Z"), meaning the seconds from the model’s time origin to that instant, with no leap seconds.

The time origin is the model’s, by esm-spec §2.2.7: domain.temporal.reference_time, else domain.temporal.start, else 1970-01-01T00:00:00Z (POSIX time). A timestamp from the caller or the run config is converted exactly as EarthSciAST converts a solver.time_span timestamp, so all three sources share one clock (D74; this replaces the M0 rule that fixed run-config timestamps at the POSIX epoch). A model with no temporal anchor whose $t = 0$ is its own start takes numbers. start and end are both numbers or both timestamps; the schema refuses a mix. A timestamp names a real instant: the schema bounds each field and has no second 60 (no leap seconds), and the planner refuses a day the month does not have (§8 rule 14).

The end must be after the start (§8 rule 14). The caller gives a time the same way. solver.time_span numbers are seconds of the document’s independent variable (esm-spec §2.2.7); a timestamp anywhere is refused when the model’s origin field is present but unreadable (§8 rule 14).

Times derived from the interval count from model time zero, not from $t_0$: hit_multiples (§5) and every firing times (§4.9). With timestamps they are therefore aligned to UTC, so a hit_multiples of "1 h" falls on the hour. The one exception is a fixed step.dt, whose macro steps start at $t_0$ (§5).

The planner resolves the interval afresh for every run, from the sources that run has, and records it in seconds in the plan (spec/plan.md §3). The plan does not record which source gave it, so the same interval always gives the same plan. A plan is stale when the interval resolved for a run differs from the one it records.

2. Conventions

2.1 Names

  • A qualified name is a model variable, parameter or observed, namespaced by component path with dots: ssa.nuH, wsm6.dtcld. It is resolved against the flattened model.
  • An operator name is a plain identifier defined under operators, or a default operator (§3.3).
  • The four locality names pointwise, column, stencil and global are reserved. They are never operator names, so wherever a value may be either (§4.5), there is no ambiguity.
  • auto and default are reserved too: auto because it is the planner’s-choice value (§2.3), and default because it is the fallback key of precision (§7.1), whose other keys are operator names and node ids. Neither is an operator name or a node id.
  • Names beginning default_ are reserved for the default operators (§3.3).
  • A node id is an optional identifier on any schedule node, unique within the schedule. Precision, partition and output may refer to a node by id. The planner gives every node an id in the plan: unnamed nodes get their path from the root (root, root.0, root.1.every; spec/plan.md §7.1). A run config may write a path-form id only on the node whose path it is.

2.2 Durations

A duration is positive. It is one of:

  • a number of seconds;
  • a string "<number> <unit>", with the space optional, where the unit is s, min (60 s), h (3600 s) or day (86 400 s). The number’s digits before any exponent are not all zero, so "0 s" and "0.0 day" are refused by the schema. Its value in seconds is the number parsed as the nearest binary64, times the unit’s seconds (an exact integer), one rounding in all (spec/plan.md §7.1);
  • the qualified name of a model parameter whose value is in seconds (WRF’s chemdt). It is read once, at plan time, from the parameter’s default or the value the run supplies, and must be a positive finite number, else the planner refuses (run_config_invalid, at the duration’s key).

The words auto, step and accumulated are reserved and are never parameter names in a duration.

Years and months are not units, because they are not constant durations (D45). Year-scale settings are written in days (eqice’s bed-deformation period is "3650 day"). Calendar-aware periods, if a model needs them, would be a separate construct in a later version.

2.3 "auto"

Where the schema allows "auto", the planner chooses by the rules of architecture §3.5 and records the choice in the plan. Omitting an optional key means the same as "auto" unless the key’s description gives a different default.

3. Operators

An operator is a named group of additive right-hand-side terms, or a step map. The planner forms operators from the flattened model (architecture §3.2 pass 1).

3.1 Term operators: select

{"select": {...}, "bind_dt": {...}}.

  • The planner splits every D(x, t) right-hand side into additive terms: the summands of each U2 contribution (spec/plan.md §5.1.1, D64). Each term carries its provenance, the component (or coupling entry) that authored it, written as a provenance label: the component path, coupling:<k> for the coupling entry at 0-based position $k$, or several joined by +.
  • A selector matches a term when every key present matches (conjunction):
    • components: the term’s owner is one of these components or lies under one of them. The owner is the authoring component; for a term a coupling entry wrote, it is the one other component whose variables the term reads, and a term reading variables of two or more other components has none (spec/plan.md §5.1.2, D65);
    • variables: the term contributes to one of these state variables;
    • locality: the term’s locality (architecture §3.2 pass 2) is one of these;
    • terms: the term’s provenance label is listed exactly.
  • Each term belongs to exactly one operator. A term matched by two selectors is an error naming both operators (§8). A term with no owner that no selector matches is an error when any selector uses components, since its operator would otherwise be chosen by default (§8 rule 4).
  • Algebraic equations are selected the same way and form algebraic operators, which a solve node (§4.10) or a coupled node (§4.3) advances. An algebraic equation is an implicit equation of the flattened model: one whose left-hand side is an expression or a number rather than an unknown, bare, indexed or under D (EarthSciAST’s algebraic strip class, API_SPEC §5.8). Its residual is $g = \text{rhs} - \text{lhs}$ (D95), and its id and origin are the ones EarthSciAST’s stripped object gives it: <prefix>.residual[j], <prefix> the declaring component’s path or coupling[k], $j$ 1-based over that origin’s implicit equations in flattened order. For an algebraic equation, components matches its owner (its origin component, or for a coupling origin the one component whose names it reads, spec/plan.md §5.9.1), variables matches when it reads a listed variable directly or through observeds, terms matches its id, and locality never matches. An operator whose selector matches both terms and algebraic equations is refused (rule 20).
  • bind_dt (§4.4) here applies wherever the operator is advanced.

3.2 Map operators: map

{"map": {"<target>": "<observed>", ...}, "bind_dt": {...}}.

  • Each target is a state variable or parameter, and each source is a qualified observed that computes its new value. A model writes a map as an observed that reads dt (eqice stage2/geometry.esm), and bind_dt binds that dt.
  • All sources are evaluated at the pre-map state, then all targets are assigned at once.
  • A map that targets parameters is how esm parameter update rules run (architecture §3.2 pass 1).

3.3 Default operators

Terms no selector matches fall into default operators, one per locality, named default_pointwise, default_column, default_stencil and default_global. Algebraic equations no selector matches fall into one default algebraic operator, default_algebraic. A default operator exists only if it has terms or algebraic equations. It may be named in the schedule like any other.

3.4 Step limits

A step limit (in step.limits or subcycle.limits) is a qualified observed whose value is the largest admissible step in seconds, such as a CFL bound, or {"max": duration}. The planner compiles each observed limit as a limit operator (architecture §3.2 pass 1).

4. The schedule

The schedule is a tree of nodes. Every node advances the model over an interval [t, t+Δ] that its parent gives it; the root receives the macro step (§5). Exactly one combinator key identifies a node’s kind.

4.1 "auto"

"schedule": "auto" asks for the default composition (D21): a sequence of one leaf per locality in the order stencil → column → pointwise, upgraded to strang when the model’s solver.splitting hint asks for it. Each leaf’s options are chosen by architecture §3.5.

4.2 leaf

{"leaf": <operators>, "alg": ..., ...} advances the sum of its operators over [t, t+Δ] with one method.

  • alg names the method (architecture §5). Tableau coefficients and controller constants are OrdinaryDiffEq’s (D31).
  • Substeps. With dt omitted, the leaf steps adaptively under control and may take any number of substeps; the last substep ends exactly at t+Δ. A numeric dt gives fixed substeps, the last shortened to land on t+Δ. "step" takes exactly one step of size Δ. "accumulated" takes one step whose size is the time since this leaf last ran (equal to Δ unless the leaf sits under every).
  • Methods without an error estimate. Adaptive stepping needs an embedded error estimate. ForwardEuler, SSPRK33, SSPRK104, WRF_RK3, IMEXEuler and Theta have none, so a leaf using one of them must give dt (D52). Legacy increments use "step". An alg of "auto" with dt omitted resolves to a method that has an estimate, and on a stiff leaf never to SDIRK2, Kvaerno3 or Kvaerno4, whose estimate is unreliable on stiff problems (D59).
  • control: reltol and abstol (a number, or per variable); dt0, dtmin, dtmax; controller (PI, I or PID, with OrdinaryDiffEqCore’s constants per method); dt_scope (global, shard or cell: which DOFs share one controller, spec/partitioning.md §2; an omitted or "auto" dt_scope is cell for a pointwise leaf whose storage is block_diagonal and that has no bind_dt: "leaf" parameter, and global otherwise, D17, D97; cell and shard are allowed only on such pointwise leaves, rule 19, and on column leaves once column lane pools are implemented, rule 16); maxiters. Omitted tolerances default to DiffEqBase’s, reltol $10^{-3}$ and abstol $10^{-6}$. An implicit leaf (SDIRK, IMEX Euler, θ-method) uses the tolerances at fixed dt too, to scale its Newton increments (spec/methods.md §5.2). A non-finite error estimate is a reject. A step below dtmin ends the run with a return code instead of hanging (architecture §5.1).
  • jacobian: symbolic (EarthSciASTDiff band models), ad (DifferentiationInterface, Julia only, D38) or fd.
  • linsolve: the W-matrix solver of architecture §6.1, or dense_lu, a dense LU of the whole system, for toy problems and tests only (operator-interface.md §4). The planner resolves an omitted or "auto" linsolve by spec/plan.md §5.5.3; for the hand-written toy problems of M1, which the planner does not plan, the default is block_lu for a block_diagonal leaf and dense_lu otherwise. banded (M4b, D131) factors each column of a column leaf (operator-interface.md §4, spec/methods.md §4.2) and takes no options; it needs the leaf’s storage to be column, and a leaf whose storage cannot be is refused when it is built. As an object it carries options: block_lu.pivot (default true), refine (iterative-refinement sweeps for low-precision factors, architecture §8), Krylov restart, rtol, maxiter, precond and fallback (the preconditioner tried when the first fails to converge).
  • domain: nonnegative ("all" or a list of variables), on_violation (reject, the default, D19; or clip), and check_stages (also check Rosenbrock stage values). A state whose model variable has lb 0 and no ub (U18) is nonnegative whether listed or not; a state with any other bound is refused until bounds on states are specified (rule 16, unsupported_state_bounds). Bounds on parameters and observeds that are not a solve node’s unknowns are ignored (D95).
  • imex (§4.5), implicit_solve (§4.5), frozen (§4.6), partition (§6; a leaf only, since a coupled node is not sharded at M2), bind_dt (§4.4) and theta (the θ-method’s off-centring, in $[0, 1]$). theta is required when alg is Theta, and a leaf without it is refused; it has no default.

4.3 coupled

{"coupled": <operators>, ...} takes the same options as leaf. Without algebraic operators it is the same as a leaf. With algebraic operators it is a semi-explicit index-1 DAE integrated monolithically (D3b, D122; architecture §6.4):

  • The system. $u’ = f(u, z)$, $0 = g(u, z)$: $u$ the states the node’s term operators write, $f$ their sum, $g$ the residuals of its algebraic operators and $z$ the algebraic unknowns those residuals read (directly or through observeds), paired with the residuals by structural matching (§4.10, D120). As $M,y’ = F(y)$ with $y = (u, z)$, $M = \mathrm{diag}(I, 0)$ is never assembled (spec/methods.md §14). A coupled node has no unknowns key: its unknowns are those its residuals read.
  • Methods. A stiffly accurate Rosenbrock or ESDIRK method: Rodas3, Rodas4, Rodas5P, TRBDF2, Kvaerno3, Kvaerno4; "auto" resolves to Rodas4. Any other alg, and imex, are refused (rule 20). The error norm runs over $u$ and $z$.
  • Consistent initialization. At the start of every invocation the node solves $g(u, z) = 0$ for $z$ with $u$ as handed in, starting from the current $z$, since an operator split may hand it a $u$ its $z$ was not solved for. initialize is the method, written as a solve node’s method (§4.10) and defaulting to {"newton": {}, "linesearch": "backtracking", "converged": {"residual": 1e-10}, "maxiter": 100}. A failure ends the node with InitialFailure (spec/methods.md §12).
  • A bounded unknown (§4.10) in a DAE is refused (unsupported_dae_bounds, rule 16): a complementarity DAE is not specified.
  • On a node with two or more algebraic operators, an initialize with picard, converged.rel_change, a scale that names a variable, or a block linsolve is refused (unsupported_dae_initialize, rule 16, spec/plan.md §7.1): the frozen documents and block structure they need are per operator. An omitted or "auto" linsolve is dense_lu there.

4.4 bind_dt

bind_dt maps a model parameter to a step size, set before every evaluation that reads it:

  • "leaf": the size of the step the leaf’s method is actually taking. With dt: "step" and alg: "ForwardEuler", this reproduces a legacy (x_out − x_in)/dt tendency exactly (architecture §4.3).
  • "node": the Δ the enclosing node received.
  • "macro": the macro step.

A bound parameter is a constant of the adjoint’s frozen tape, so it cannot appear in adjoint.wrt (spec/adjoint.md §5.8).

4.5 IMEX partitions

imex: {"explicit": ..., "implicit": ...} splits a leaf’s terms between the explicit and implicit parts of an IMEX method. Entries are operator names, or locality names that select the leaf’s terms of that locality. Every term of the leaf must land in exactly one part; explicit may be omitted, meaning “everything not implicit”, or empty when every term is implicit (the form a resolved plan writes, spec/plan.md §7.1). implicit is required, and an empty implicit list is refused. In v1 the only IMEX method is IMEXEuler (D35). Its implicit part is solved to convergence by Newton with the leaf’s linsolve unless implicit_solve: "linearized" asks for a single linearized step (D43); the two coincide when the implicit terms are linear in the state and independent of $t$, since the linearized step evaluates $f_I$ at $(u_n, t_n)$ and the converged step at $(u_{n+1}, t_n + h)$ (for $f_I = -k u + c(t)$ they differ by $h(I - hJ)^{-1}(c(t_n + h) - c(t_n))$). Implementations run the implicit_solve the leaf asks for in every case and never substitute one for the other.

4.6 frozen

frozen: [...] on a leaf, coupled or split_explicit node lists operators whose tendency is evaluated once, at the start of each step of that node, and added as a constant to every stage of that step (WRF rk_addtend_dry). An entry {"every": op, "period": ..., "hold": "tendency"} is re-evaluated only on steps where every fires (§4.9) and held in between (WRF radt).

frozen is an option of the node whose stages it feeds, not a standalone node (D47). Alone in a sequence, a frozen tendency would just be a forward Euler step.

4.7 sequence and strang

  • sequence: the children in order, each over the whole [t, t+Δ] (Lie–Trotter). With maps and solves among the children this is PISM’s ordered step.
  • strang: for children a, b: a(Δ/2) b(Δ) a(Δ/2). For n children c₁ … cₙ: c₁(Δ/2) … cₙ₋₁(Δ/2) cₙ(Δ) cₙ₋₁(Δ/2) … c₁(Δ/2). Each half is a separate invocation with its own step sequence.

4.8 subcycle

{"subcycle": node, "n": k} runs the child k times with Δ/k: substep $i$ starts at $t + i,(Δ/k)$, and the last ends at $t + Δ$ exactly. {"subcycle": node, "limits": [...]} runs it adaptively: each substep is the minimum of the limits evaluated at the substep’s start state and the time remaining, floored at the subcycle’s own resolution when it gives one (a duration, or "none" for no floor, D142), else at step.resolution. The substep sequence is recorded on the tape.

4.9 every

{"every": node, "period": P, "phase": φ, "hold": ...}.

  • The node fires in an invocation over [t, t+Δ] when some φ + kP, k ≥ 0, lies in [t, t+Δ).
  • Under step.limits, firing times are tstops (§5), so a firing time is always the start of a macro step.
  • Under a fixed step.dt, firing times are not tstops, and P and φ need not be multiples of dt (D50). The node fires on the macro step that contains the firing time, as WRF fires radiation every radt and chemistry every chemdt on whichever step crosses the period. If one macro step contains several firing times, the node fires once.
  • When it fires, the child runs over an interval of length Δₑ ending at t+Δ, where Δₑ is the time since the end of the previous firing (or since the start of the run). This is how WRF-Chem advances chemistry by chemdt and how PISM’s bed deformation accumulates its step (D48). Bindings with "node" see Δₑ.
  • When it does not fire, it is the identity.
  • hold: "tendency": at a firing, the child’s tendency is evaluated and then added as a constant to the right-hand side of every leaf among the enclosing node’s other descendants, until the next firing. The child itself is not advanced. Its child must then be a single leaf.

4.10 map and solve

  • {"map": op} applies a map operator (§3.2): its sources are evaluated at the state, parameters and time at the start of the node’s interval, with the parameters its bind_dt binds set (node: the node’s Δ), and then every target is assigned at once. A plan writes the operator’s bind_dt on the node (spec/plan.md §7.1).
  • {"solve": op, "unknowns": [...], "method": {...}, "warm_start": ...} solves the algebraic operator op for the listed unknowns with everything else frozen (architecture §6.3). method holds exactly one of newton (with inexact: true for an inexact Newton–Krylov step with Eisenstat–Walker forcing, preconditioned by the node’s linsolve; spec/methods.md §15.3, D126), picard (with its freeze list, the observeds treated as constants when differentiating the residual for the iteration; this is the only place freezing is written, D25, D51) or ptc (pseudo-transient continuation), plus linsolve, linesearch, anderson (memory depth), converged (residual tolerance, or rel_change of a named observed with tol and optionally norm: "l2", the default, or {"l1_by": X} with X one of the observed’s index sets, PISM’s Picard test, spec/methods.md §15.2, D137), maxiter, scale and recover. ptc takes dt0 and growth, a number above 1 or "uncapped" (spec/methods.md §15.4). recover is a ladder tried in order on failure: under-relaxation, scaling a regularization parameter by a factor up to max times, revert_warm_start, and {"method": M}, an attempt with another method (newton or ptc with its options, linesearch, maxiter; spec/methods.md §15.7). warm_start is previous (the last converged value, the default) or initial.
  • Bounded unknowns (D95). An unknown whose model variable carries lb or ub (U18) makes the solve bound-constrained; the run config does not state bounds, since a bound is part of the model’s physics: the model’s 0 ~ g holds only off the bound. Either bound may be absent. A bound is a number, applied to every element of an array unknown, or a reference to another variable, parameter or observed of the model, one bound per element. EarthSciAST (esm 2.1.0) checks that a reference resolves, is a scalar or of the unknown’s shape, and does not depend on the bounded variable itself through observeds; a bound that is, or depends through observeds on, another unknown of the same solve node passes those checks but would move during the solve, so the planner refuses it (rule 18). A referenced bound is evaluated once per invocation, from the frozen state and parameters (and again after a recover scale_param action changes a parameter, from the scaled ones, spec/methods.md §15.7): a parameter, or an observed that depends on no state, directly or through other observeds (a state-free observed, D125; its value reaches the runtime through the operator’s frozen residual document, spec/plan.md §6.5). A reference to a state, or to an observed that depends on one, is refused (unsupported_bound_reference, rule 16; a bound that moves with the state is a later addition); an element whose lower bound exceeds its upper bound fails the invocation, naming the node, the unknown and the element, and no recover action applies. With $g$ the operator’s residual, its component $g_i$ paired with the unknown’s component $z_i$ as ptc pairs them (the pseudo-time rate of $z_i$ is $g_i$, below), the solution is the solution of the mixed complementarity problem $$l_i \le z_i \le u_i, \qquad g_i(z) = 0 \text{ if } l_i < z_i < u_i, \qquad g_i(z) \le 0 \text{ if } z_i = l_i, \qquad g_i(z) \ge 0 \text{ if } z_i = u_i,$$ equivalently $z = \Pi_{[l,u]}\big(z + g(z)\big)$, the steady state of the projected pseudo-time flow $dz/d\tau = g(z)$. Unbounded unknowns of the same node keep $g_i = 0$. The motivating case is a solid phase that cannot be negative: MOSAIC’s MESA solid salts (EqWeFiC), whose rate $S_s - 1$ dissolves an undersaturated salt until none is left, so the equilibrium is $E_s \ge 0$, $S_s \le 1$, $E_s (S_s - 1) = 0$; an upper cap (a salt’s solid amount cannot exceed its total) would be a referenced bound, though EqWeFiC’s document states only lb 0. A leaf’s domain.nonnegative (§4.2) does not express this: it keeps a time integration’s states nonnegative, and a solve node has no states.
    • Scale (D125). A method’s scale maps unknowns of the node to a positive scale: a number, applied to every element, or the name of a parameter or a state-free observed, a scalar or of the unknown’s shape, one scale per element; an unknown it does not name has scale 1. The iteration works on the scaled residual $D g$ (spec/methods.md §15.1), so the complementarity reformulation $z - \operatorname{mid}(l, z + D g, u)$ compares $z$ with a rate of the same units: MOSAIC’s MESA solid salts $E_s$ (amounts) with $S_s - 1$ (dimensionless), scaled by each salt’s amount in the bin, the time scale MOSAIC’s own mesa_ptc steps each salt by. The convergence test and the active set use the unscaled residual, so a scale changes the path, never the solution or the tolerance. A referenced scale is evaluated once per invocation, as a referenced bound is; an element that is not positive and finite fails the invocation, naming the node, the unknown and the element (a model states a floor itself if a scale can vanish). A key that is not an unknown of the node (a solve node’s unknowns, a coupled node’s algebraic unknowns for initialize) is name_wrong_kind (rule 2), a value that names neither a parameter nor an observed likewise; a value that is a state-dependent observed, or whose shape is neither scalar nor the unknown’s, is solve_scale_invalid (rule 18).
    • The sign of $g$. A bound makes the residual’s sign part of the problem (at a lower bound $g_i \le 0$), so it is fixed: the residual of an algebraic equation lhs ~ rhs is $g = \text{rhs} - \text{lhs}$, and a model states a bounded unknown’s rate $g$ as the constraint 0 ~ g (EqWeFiC’s couplings/mosaic_mesa_equilibrium.esm writes 0 ~ g with $g_s = S_s - 1$). ptc uses the same sign with or without bounds: it integrates $dz/d\tau = g(z)$ by linearly implicit Euler pseudo-steps of size $\delta$, $(\delta^{-1} I - g_z), s = g$, $z \leftarrow z + s$, which settles only where the flow is stable. Without bounds, newton and picard find the same zeros whatever the sign; with bounds, a residual of the wrong sign flips the complementarity conditions and gives a different, wrong solution. Which component of $g$ pairs with which component of $z$ is the node’s pairing: a perfect structural matching of its residual blocks with its unknown blocks, chosen by spec/plan.md §5.9’s canonical rule (D120), element $i$ of a residual with element $i$ of its unknown; the planner MUST NOT pair a bounded unknown with an equation it has negated or rearranged, and refuses a node whose bounded unknowns could be paired more than one way (solve_pairing_ambiguous, rule 20). The planner also checks the sign (rule 18, solve_bounds_sign): at each state the operator’s band check samples (spec/plan.md §8.1), every bounded component’s diagonal Jacobian entry $\partial g_i / \partial z_i$, $g_i$ the residual element paired with $z_i$, MUST NOT be positive. A problem with a unique solution for every box ($-g_z$ a P-matrix) has a negative diagonal, so the check refuses no correctly signed model of that kind; it does not catch every wrong sign. Informative: a component whose $g_i$ is identically zero over the region a solve visits (a salt the model does not let exchange) has a zero Jacobian row: ptc leaves it at its warm start, and newton needs it removed from the unknowns or regularized.
    • Methods. Every method first projects its starting iterate (the warm start, or the model’s initial value under warm_start: initial) onto the box, so every iterate lies in it. ptc projects every pseudo-time step onto the box; newton solves the semismooth reformulation $r(z) = z - \operatorname{mid}\big(l,, z + g(z),, u\big) = 0$ with an element of its generalized Jacobian (the rows of components where mid takes a bound replaced by the identity’s); picard projects every iterate.
    • Convergence. A bounded solve converges on converged.residual, measured on $r$ in the norm an unbounded solve’s residual uses; on a component strictly inside its box $r_i = -g_i$. converged.rel_change is refused for a solve with a bounded unknown (rule 18): a small change in an observed does not show that the complementarity conditions hold.
    • The active set. With $\epsilon$ the converged.residual tolerance, a component of the converged iterate is at its lower bound when $z_i + g_i \le l_i$ (the branch mid takes) or when $z_i - l_i \le \epsilon$ and $|g_i| \le \epsilon$; at its upper bound likewise, $z_i + g_i \ge u_i$, or $u_i - z_i \le \epsilon$ and $|g_i| \le \epsilon$ (the lower bound wins when both hold); otherwise it is free. A component at a bound is set to the bound exactly, which moves it by at most $\epsilon$ since $|r_i| \le \epsilon$, and the converged $z$ is stored so. A component at a bound with $|g_i| \le \epsilon$ is degenerate (not strictly complementary, to tolerance): the solution map has a kink there. The tape records, per bounded unknown, the elements at each bound and the degenerate ones (spec/tape.md §2), and the adjoint differentiates on them (spec/adjoint.md §4.6). Whether an element is degenerate can differ between implementations at the last bits; a degenerate element’s derivative is one-sided either way, and cross-language comparison of a gradient that depends on one is not required.

4.11 split_explicit

WRF’s RK3 (Wicker–Skamarock: Δ/3, Δ/2, Δ) on slow, with fast advanced by substeps forward–backward substeps inside each stage, vertically implicit with epssm off-centring, and frozen tendencies added to every stage (architecture §4.3). Specified in v1, implemented at M7.

5. The macro step: step

At most one of:

  • dt: a fixed macro step. The macro steps start at $t_0, t_0 + \texttt{dt}, \ldots$, and every tstop must fall on one of them (§8 rule 9), except inside the macro step of a root leaf or coupled node that lands on stops itself.
  • limits: Δ is the minimum of the limits evaluated at the macro step’s start state, and the distance to the next tstop. With after (D138), the id of a child of the root sequence that, with every child before it, is a solve node, the limits are evaluated instead after those leading solve nodes have run, at the macro step’s start time, on the state they leave (PISM computes its step after the stress balance, from the new velocities); the macro step then runs its remaining children over $[t_a, t_a + Δ]$, and the leading solves count as part of it (their tape records carry its Δ). after naming anything else is step_after_invalid (rule 12). An observed limit is evaluated from its limit document (spec/plan.md §6.8) at the macro step’s start state, parameters and time; +Inf restricts nothing; a limit that is NaN ends the run with DtNaN, and one that is zero or negative with DtLessThanMin (spec/methods.md §12). So does a step under limits (the macro step’s, or an adaptive subcycle’s substep) that is not a stop step and is too small to move the clock, $t + h = t$ in floating point: it would never advance $t$.
  • Neither: allowed only when the schedule’s root is a single adaptive leaf or coupled node (D49). That node’s accepted steps are the macro steps; it steps adaptively under its own control and lands exactly on every tstop. Omitting step entirely is the same as {}.

Then, for both:

  • tstops are the times named by hit:

    • forcing_refresh: the times any forcing provider’s two-record bracket changes, which start forcing epochs (architecture §7.5). For a provider that brackets consecutive records these are its record timestamps. This is the only forcing hit source (D46);
    • output, restart: the output and restart times;
    • events: preset and periodic event times of the model.

    The observation times of the adjoint functional (spec/adjoint.md §2.1) are always tstops, whether or not hit names their source. Under limits or with neither key, every firing times (§4.9) are tstops too. The interval is (t₀, t_f], from §1.1, so a boundary at t_f is hit (architecture §7.5).

  • hit_multiples additionally makes every multiple of a duration a tstop.

  • resolution floors Δ to a multiple of it, and Δ is never less than one resolution unless a tstop is closer.

  • The step under limits, exactly (D132). From the macro step’s start $t_a$: $L$ is the smallest value among the limits entries (an observed’s value, or a {"max": d}’s $d$), compared in written order with < so the first entry achieving it is its source; with resolution $r$, $L \leftarrow \max(r,\ r \cdot \lfloor L / r \rfloor)$ in binary64. $\tau$ is the first tstop after $t_a$ ($t_f$ included). The step is $h = \min(L, \tau - t_a)$, its reason $L$’s source (the observed’s qualified name, or "max") when $L \le \tau - t_a$, else "tstop"; then spec/methods.md §10’s stop rule with $h$ and $t_{\text{stop}} = \tau$ decides whether the step lands on $\tau$ (it ends at $\tau$ exactly, the reason unchanged when it was not "tstop"). An adaptive subcycle substep (§4.8) is the same with the subcycle’s limits, step.resolution, and the end of the subcycle’s interval in place of $\tau$, its reason "remaining" in place of "tstop".

  • Ties. Each macro step records the reason for its size: the first source achieving the minimum, taking the entries of limits in the order listed (a {"max": ...} entry counts at its own position in the list), then the next tstop. The reason is deterministic, so two implementations agree on it (PISM bugs.md #11). Adaptive subcycle substeps (§4.8) record their reason by the same rule over the subcycle’s limits, then the time remaining.

  • Fixed boundaries. Under dt, macro step $k$ runs over $[t_0 + k,\texttt{dt},\ t_0 + (k+1),\texttt{dt}]$, each end computed by multiplication, and the last ends at $t_f$. A tstop $\tau$ falls on a boundary $b$ when $|\tau - b| \le 100,\epsilon(\max(|\tau|, |b|))$, the landing tolerance of spec/methods.md §10; that boundary is then $\tau$ exactly (the earlier, if two fall on it). So with dt 0.1 an output at 0.3 falls on $3 \times 0.1 = 0.30000000000000004$, and the state is reported at 0.3. A macro step is the last when, from its start $t_a$, the stop rule of spec/methods.md §10 with $h = \texttt{dt}$ and $t_{\text{stop}} = t_f$ makes it a stop step; the number of macro steps is never computed by dividing. So dt 0.1 on $[0, 0.3]$ takes three macro steps, although $(0.3 - 0)/0.1 = 2.9999999999999996$.

  • The macro step has no error control of its own (D49). Leaves adapt inside it. A schedule whose root is a single adaptive leaf behaves like an ordinary adaptive integration, because the planner then gives that leaf’s accepted steps the role of macro steps.

6. Partition

6.1 Axes

axes: {"horizontal": [h_1, h_2], "vertical": v, "faces": {f: a, …}} names the roles of the model’s index sets (D67). faces (optional, D105) maps each face index set to the horizontal or vertical axis it staggers off, cell $i$ owning face $i$, its low face, so a face set has one element more than its axis; locality analysis pairs a face set with its axis (spec/plan.md §5.2.1, §5.2.3), and the planner warns about an undeclared index set one element longer than an axis. Locality analysis (architecture §3.2 pass 2) reads offsets on the vertical axis as column reach and offsets on horizontal axes as stencil reach; an index set a state uses that axes names neither horizontal nor vertical lies inside a cell, and a coupling along it, an offset or a sum over the whole axis, keeps the class (D123; MOSAIC’s salts inside a size bin); ranks and tiles divide h_1 by their first entry and h_2 by their second. Defaults: no vertical axis, and every index set that shapes a state variable, other than the vertical one, horizontal in the model’s index_sets order. A model without a vertical axis has no column operators. The planner refuses an index set that does not exist, one named twice, or more than two horizontal axes after defaults (spec/plan.md §5.2.1).

6.2 Decomposition

  • ranks: the 2-D grid of MPI ranks over the horizontal axes. Decomposition is horizontal only (D20).
  • tiles: the 2-D grid of thread tiles within each rank.
  • shards: shard counts per operator or node id, for pointwise and column leaves. A leaf’s own partition (shards, or shard_size in lanes) overrides it. An entry for a coupled node, or for an operator a coupled node names, is refused (spec/plan.md §7.4).
  • A leaf’s own partition also takes lanes, the lane capacity of its lane pools (omitted: the runtime chooses; it changes no result; ignored on a stencil or global leaf, which has no lanes), and reshard, "none" (the default) or {"every": k}, which re-composes a dt_scope: shard leaf’s shards every $k$ macro steps (spec/partitioning.md §6.2, §10.1).
  • The number of threads is not a run-config key: it is a run-time option of the runtime, since no result depends on it (spec/partitioning.md §4, D99).

The planner derives halo widths and shard sizing (architecture §3.2 pass 7). Results are bitwise identical for a fixed decomposition (D10); under dt_scope cell and global they are bitwise identical for every shard, tile and thread count within a rank (spec/partitioning.md §9.1, D97).

7. Precision, adjoint, output, restart

7.1 precision

Precision roles per leaf (architecture §8, D18, D29). Keys are default, operator names or node ids (default is never either, §2.1); a more specific key overrides default role by role.

RoleAllowed
state, rhsf32, f64. Must equal a declared element_type; free where the document leaves it unspecified (U14). rhs ≥ state.
jacobian, factors, tablesf16, bf16, f32, f64, under any declaration.

Time, dt, error norms, reductions and adjoint accumulators are always f64 and are not configurable. The planner refuses a low-precision jacobian or factors with a classical Rosenbrock method (Rodas) unless overridden (architecture §8).

7.2 adjoint

  • functional: the reduction (mean or sum) of one quantity, restricted by where (index-set name → 1-based index or inclusive range), over the run: time (the integral term, spec/adjoint.md §2.1), final (the end state), or saveat (a point term at each output time after $t_0$). For time, integrate_in names the leaf, by node id, that integrates the term; the default is the last leaf of the macro-step schedule (D39).
  • wrt: what to differentiate with respect to. params:numeric is every numeric scalar parameter; params:<pattern>, fields:<pattern> (gridded array parameters) and forcing:<pattern> (forcing fields, accumulated per provider record, D5) take a glob over qualified names, where * matches any characters including dots; u0 is the initial state. A parameter bound by bind_dt is not differentiated: a pattern such as params:numeric or params:* that matches one gives it a zero entry, while an entry that names it is refused (§8 rule 11).
  • checkpoint: every (macro_step or a count of macro steps), store levels, and the schedule the planner computes (D34): all, revolve or multilevel, with snapshots slots.

The math is in adjoint.md .

7.3 output and restart

  • output.sinks: EarthSciIO sinks by path, with variables and their own saveat; output.saveat is the default. Output times are tstops, so saveat never needs dense output in v1. saveat is a duration $d$, and the output times are its multiples $k,d$ ($k$ an integer, each the binary64 product), counted from model time zero (the model’s time origin, §1.1, D74) like hit_multiples, that lie in $(t_0, t_f]$, with the landing tolerance of §5 “Fixed boundaries” at both ends: a multiple within it of $t_f$ is the output time $t_f$, written as $t_f$, and a multiple within it of $t_0$ is excluded, like $t_0$. $t_f$ is not added when no multiple lands on it (D83). So $d = 0.1$ on $[0, 0.3]$ gives 0.1, 0.2 and 0.3, although $3 \times 0.1$ is 0.30000000000000004. With no saveat the output time is $t_f$ alone. The initial state is always reported, and a functional over saveat has no term at $t_0$.
  • output.accumulators: name → observed. The planner adds each as an integrated state (D26).
  • restart: path, cadence every, and from, a restart store to start from. Restart is bitwise for the same decomposition (architecture §11).

7.4 Data

The run config names no data: where the data is, which records a parameter receives and how they are read are the model’s own declarations (its data_sources and each data-fed parameter’s update.from; spec/plan.md §4.1). The runtime’s cache directory, offline mode and URL overrides are run-time options, not run-config keys (spec/operator-interface.md §8.4.2). A model with an operator that reads a time-varying data-fed parameter must name forcing_refresh in step.hit (§5; spec/plan.md §7.3).

8. Rules the planner checks

The schema checks structure. The planner additionally refuses, naming the offending key:

  1. a model that does not load, or a solver.external that does not name this file back (§1);
  2. a qualified name that does not resolve in the flattened model, or resolves to the wrong kind (a map target that is not a state variable or parameter, a map source that is not an observed or has another shape than its target (map_shape_mismatch), a limit that is not a scalar observed, a bind_dt key that is not a parameter, a per-variable abstol key or domain.nonnegative entry that is not a state), or a precision key that is not default, an operator name or a node id;
  3. an operator name used in the schedule (a leaf or coupled list, a frozen entry, an imex entry, or a map node) that is neither defined nor an existing default operator;
  4. a term selected by two operators, an operator whose selector matches nothing, or a term with no owner that no selector matches while some selector uses components (§3.1);
  5. an operator that the schedule never advances, or advances twice in one invocation outside strang: an operator named by two leaf, coupled or solve nodes (a strang running a child twice is one place). A frozen entry counts as advancing for “never advances” but not for “twice” (spec/plan.md §7.1, D84);
  6. an imex partition that leaves a term in neither part or in both, or an IMEXEuler leaf with no imex; checked only on leaves whose written alg is IMEXEuler, and an imex key on any other leaf is ignored (spec/plan.md §7.1);
  7. duplicate node ids, or a path-form id on a node whose path it is not (§2.1);
  8. a hold: "tendency" every whose child is not a single leaf;
  9. a tstop that is not $t_0$ plus a multiple of a fixed step.dt (every firing times are not tstops then, §4.9), unless the schedule’s root is a single leaf or coupled node with dt omitted or numeric, which lands on such tstops inside the macro step; a root leaf with dt "step" or "accumulated" takes one step per macro step and cannot;
  10. a precision role that contradicts a declared element_type, or rhs below state;
  11. a wrt entry that matches nothing, or names a parameter bound by bind_dt;
  12. a step with neither dt nor limits whose schedule root is not a single adaptive leaf or coupled node (§5) (step_control_missing); a step.after that is not a child of the root sequence with only solve nodes at or before it (step_after_invalid, D138);
  13. a leaf with dt omitted whose method has no error estimate (§4.2);
  14. no run interval from any source; one whose end is not after its start; a timestamp naming a day its month does not have, or a malformed timestamp in the caller’s interval or the model’s solver.time_span (a malformed run-config timestamp fails the run-config schema instead and is run_config_invalid; spec/plan.md §7.2); or a timestamp from any source when the model’s time-origin field is present but unreadable (§1.1);
  15. a leaf with dt omitted that has a bind_dt: "leaf" parameter but no control.dt0, since the first-step algorithm evaluates the right-hand side before any step size exists (spec/methods.md §9);
  16. split_explicit, crossing parameter-update rules (D22; unsupported_crossing_update wins over the general unsupported_parameter_update), or any other construct this version specifies but no implementation yet supports, with a refusal that says so.
  17. a data-fed parameter that receives two records (its record shape begins with a record axis, "records": true) but whose source’s temporal block does not make it time-varying (what EarthSciAST checks itself, a record axis on a source without temporal.start or a record axis not of size 2, is refused at load); a used data-fed parameter without a nonzero default at every element; a model in which an operator reads a time-varying data-fed parameter but whose step.hit lacks forcing_refresh; an operator whose stiffness would be classified by the Gershgorin bound although its Jacobian reads a data-fed parameter (spec/plan.md §4.1, §5.5.2, §7.3; D87).
  18. a solve node with a bounded unknown (§4.10) whose converged criterion is rel_change, or whose referenced bound is, or depends through observeds on, one of the node’s unknowns (solve_bounds_invalid), and a bounded component whose diagonal Jacobian entry $\partial g_i/\partial z_i$ is positive at a sampled state (solve_bounds_sign) (§4.10, D95); and a method’s scale that names a state-dependent observed or has the wrong shape (solve_scale_invalid, §4.10, D125). Whether a bound’s reference resolves, its shape, its independence of the bounded variable and a numeric lb above ub are EarthSciAST’s checks at load (model_load_failed). Each case has a refusal fixture (spec/plan.md §0.1).
  19. a control.dt_scope of cell or shard on a node whose cells cannot step alone: a leaf whose class is stencil or global, a pointwise leaf whose Jacobian storage is not block_diagonal, a leaf in whose model some array state is not over the index sets of the leaf’s state variables (D135), or a coupled node (dt_scope_not_local); cell or shard on a leaf with a bind_dt: "leaf" parameter (dt_scope_bind_dt); a leaf partition.reshard other than "none" on a leaf whose resolved dt_scope is not shard (reshard_without_shard_scope) (spec/partitioning.md §2.1, §6.2; D97, D104).
  20. algebraic structure (spec/plan.md §5.9, D120, D122): an operator whose selector matches both terms and algebraic equations (operator_mixes_kinds); a solve node naming an operator that is not algebraic, or a leaf naming an algebraic operator (operator_kind_mismatch); a solve unknown that is not an algebraic unknown of the flattened model (name_wrong_kind, rule 2); an algebraic unknown that an algebraic equation reads and no solve or coupled node solves (algebraic_unknown_unsolved), or that two nodes solve (algebraic_unknown_solved_twice); a node whose residuals and unknowns admit no perfect structural matching (solve_structurally_singular); a node whose bounded unknowns have more than one canonical pairing (solve_pairing_ambiguous); a coupled node with algebraic operators whose alg is not a stiffly accurate method of §4.3, or that has imex (dae_method_invalid).

Each refusal has a code, listed with the rule it implements in planner-errors.json (D79); a refusal reports its code and the run-config pointer, which conformance fixtures check, and a message, which they do not. Where the cause has no run-config key of its own, or the key is not obvious, the pointer is fixed, and spec/planner-errors.json gives it in the code’s description; that file is the one list of these pointers. They include "" for a schema failure and for refusals about the caller’s interval, /model for refusals about the model alone, /schedule for a default operator no node advances, and the precision entry that set the role for precision refusals. At M2, rule 16 also covers events, every parameter update rule other than a data-fed parameter’s single data rule, a loader_fields entry that names no parameter, map operators and nodes, and observed step limits (spec/plan.md §0.1, D75, amended by D87), and a state whose model variable has a bound other than lb 0 alone (unsupported_state_bounds, §4.2, D95). From M3, rule 16 also covers a control.dt_scope of cell or shard on a column leaf (unsupported_dt_scope, spec/partitioning.md §2.5); the M2 refusals of cell and shard on every leaf and of a Rosenbrock leaf on an operator that depends on $t$ (D94) are withdrawn (D97, D102). From M4b it also covers a node whose pairing needs an element-level matching (unsupported_solve_pairing, D120), a bounded unknown in a DAE (unsupported_dae_bounds, D122), an initialize that needs per-operator frozen documents or blocks on a DAE with two or more algebraic operators (unsupported_dae_initialize) and the solve options spec/methods.md §15.6 leaves unspecified (unsupported_solve_option). Data-fed parameters themselves are planned, and their refusals are rule 17’s.