Project

EarthSciAST

The EarthSciML Abstract Syntax Tree format: schema, operators, coupling, and five language bindings.

Contents

This is the documentation for the older version v0.16.0. For the latest release, see v0.17.0.

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": "2.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
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, and esm 1.x had function_tables. All six 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.
  • There is no function registry. Calendar fields, table interpolation and polygon overlap areas are standard-library expression templates; a sampled table is data passed to the linear / bilinear templates. See removed operators .
  • Data and shape

    index_sets, coordinates, metaparameters, domain, data_sources, enums.

  • metadata

    Identity and provenance for the document.

  • models

    Components with variables and equations.

  • reaction_systems

    Species and reactions, lowerable to ODEs.