Version: dev

field_reduce

Stable function · Simulation

Tier: stable · Kind: function · Topic: Simulation

JuliaTypeScriptPythonRustGo
field_reduceoutside profilenot exportedfield_reduceoutside profile

Julia

field_reduce(kind::AbstractString, actual::AbstractVector{<:Real}; reference)
field_reduce(kind, actual; reference=nothing) -> Float64

Collapse a spatial field to the scalar a §6.6.5 reduce assertion compares (esm-spec §6.6.5):

  • "L2_error" — ‖actual − reference‖₂ / ‖reference‖₂ (relative L2 over the domain; requires reference).
  • "Linf_error" — max |actual − reference| (absolute supremum norm; requires reference).
  • "integral" — the uniform-cell Riemann sum under a UNIT total domain measure per axis: Σ field / N_cells, i.e. exactly mean. This is the pinned cross-binding convention (the same measure convention under which the relative-L2 reduction is measure-free); non-unit physical domains must be scaled by the author until the spec grows a measure concept.
  • "mean" | "max" | "min" — pure collapsers of actual.

Source

TypeScript

Not available in TypeScript. TypeScript is outside the simulation capability profile (Julia, Python, Rust): build an RHS and integrate it; TypeScript and Go are deliberately non-simulating.

Python

Python does not export this function.

Rust

pub fn field_reduce(kind: &str, actual: &[f64], reference: Option<&[f64]>) -> Result<f64, String>

Collapse a spatial field to the scalar a §6.6.5 reduce assertion compares (esm-spec §6.6.5); semantics identical to the Julia / Python references:

  • "L2_error" — ‖actual − reference‖₂ / ‖reference‖₂ (relative L2 over the domain; requires reference).
  • "Linf_error" — max |actual − reference| (absolute supremum norm; requires reference).
  • "integral" — the uniform-cell Riemann sum under a UNIT total domain measure per axis: Σ field / N_cells, i.e. exactly mean. This is the pinned cross-binding convention (the same measure convention under which the relative-L2 reduction is measure-free); non-unit physical domains must be scaled by the author until the spec grows a measure concept.
  • "mean" | "max" | "min" — pure collapsers of actual.

Source · Rust docs

Go

Not available in Go. Go is outside the simulation capability profile (Julia, Python, Rust): build an RHS and integrate it; TypeScript and Go are deliberately non-simulating.