Version: dev

File structure

What goes in an .esm document, section by section.

An .esm file is a single JSON object. Two keys are always required:

KeyTypeMeaning
esmstringFormat version, semver. Currently "1.0.0".
metadataobjectIdentity and provenance. Requires name.

On top of those, a document must carry at least one of models, reaction_systems, data_sources, expression_templates, or coupling_roles โ€” a file that declares none of them is rejected by the schema. So the smallest valid document is a single empty component:

{
  "esm": "1.0.0",
  "metadata": { "name": "Minimal" },
  "models": {
    "Empty": { "variables": {}, "equations": [] }
  }
}

That parses, validates, and round-trips. It has no unknowns, so there is nothing to simulate, but it is a legal file.

The sections

SectionPurpose
metadataName, description, authors, license, provenance
modelsComponents with variables and equations
reaction_systemsSpecies and reactions, lowerable to ODEs
couplingRules composing components
coupling_rolesFormal component roles in a coupling-library file
expression_templatesmatch rewrite rules
expression_template_importsOrdered imports of template libraries
data_sourcesIngest configuration for external data
index_setsNamed index sets that array dimensions range over
coordinatesCoordinate variables, for output
metaparametersValues bound at load
function_tablesSampled function tables with named axes
enumsSymbol-to-integer maps for categorical lookups
domainThe document’s single temporal domain

Which of the five required-alternative keys a document carries determines its kind:

  • a component file carries models and/or reaction_systems;
  • a source-catalog file carries only data_sources โ€” it declares ingest configuration other documents draw from, but is not itself a component and cannot be referenced as a subsystem;
  • a template-library file carries top-level expression_templates;
  • a coupling-library file is the one that declares coupling_roles, and its presence is the sole positive identifier of that kind.

What is not here

Earlier drafts had operators, registered_functions, grids, staggering_rules, and discretizations blocks. All five are removed.

  • Grid geometry is ordinary data โ€” coordinates, extents, spacing, connectivity and metric arrays are loaded through data_sources or declared as variables, and topology is constructed with faq .
  • Discretization is a template rewrite , not a declaration.
  • The function registry is closed and lives in the spec, not in your file. See closed functions .