The ModelSpec abstraction is designed to formalize and preserve a notion of a trusted model configuration by aggregrating the information required to build and configure a particular model as a named entity.
Model specifications are defined per-model in cstar_forge/catalog/ModelSpec/<model>/model.yaml (see here). Models are discovered by scanning catalog/ModelSpec/*/model.yaml.
Each model includes:
Code repository configurations (ROMS, MARBL, PIO) and template refs (compile-time and run-time)
Per-run build-mode toggles (
bgc_mode,use_pio)Model-specific physics/numerics settings defaults (
model_settings)
Everything a Domain/Forcing/Output spec already owns (grid/IC/forcing source selection, output write-lists,
open-boundary and tidal/river presence, grid partitioning, etc.) is deliberately not duplicated here — those
values come from the selected DomainSpec//ForcingSpec//OutputSpec/ catalog entries (directories read as plain dicts; of the specs, only ModelSpec is also a Python class) and are merged in by the resolver
(build_forge_blueprint) when it assembles a ForgeBlueprint.
model.yaml Schema¶
Here’s a view of the schema:
bgc_mode: marbl # marbl|none -- prepopulates the wizard; resolver derives cppdefs.marbl from it
use_pio: false # prepopulates the wizard's PIO checkbox; resolver derives cppdefs.use_pio from it
code:
roms:
location: https://github.com/org/repo.git
commit: <hash> # or 'branch: main' instead
marbl: # optional
location: https://github.com/CWorthy-ocean/MARBL.git
commit: marbl0.45.0-max-it-10
pio: # optional; required if use_pio can be set true
location: https://github.com/CWorthy-ocean/ParallelIO.git
commit: 2.7.1-fork
# Render templates live at the forge repo root (templates/), decoupled from this
# ModelSpec. `directory` is relative to the repo root; `templates_commit` pins the
# forge commit they're fetched from (defaults to branch `main` if omitted).
templates_commit: <forge-commit-sha>
templates_compile_time:
directory: "templates/compile-time"
files:
- cppdefs.opt.j2
templates_run_time:
directory: "templates/run-time"
files:
- marbl_in
model_settings:
cppdefs:
sponge_tune: false
nhy_forcing: true
nox_forcing: true
# ...one section per model_settings namelist key (lateral_visc, vertical_mixing,
# tracer_diff2, bottom_drag, param, bgc, blk_frc, tides, marbl_bgc, etc.)Field Descriptions:¶
bgc_mode
Per-run BGC toggle (marblornone). Prepopulates the wizard’s BGC dropdown; the resolver uses it to derivemodel_settings.cppdefs.marbl(and gatenhy_forcing/nox_forcing) and to decide whethercode.marblis populated. Not itself part ofmodel_settings— it’s a build mode, not a namelist section.use_pio
Per-run ParallelIO (PIO) build toggle. Prepopulates the wizard’s PIO checkbox; the resolver uses it to derivemodel_settings.cppdefs.use_pioand to decide whethercode.piois populated (raising if PIO is requested but the model has nocode.piopin).code
Code repository and template specifications:roms: ROMS source code repository (required; specifylocationandbranchorcommit)marbl: MARBL source code repository (optional; specifylocationandbranchorcommit)pio: ParallelIO source code repository (optional; specifylocationandbranchorcommit)templates_commit: forge-repo commit thattemplates_compile_time/templates_run_timeare fetched from (defaults to branchmainwhen omitted)templates_compile_time/templates_run_time: each adirectory(relative to the forge repo root) plus afileslist.*.j2files have Jinja2 templating applied; files without that extension (e.g.marbl_in) are copied as-is.
model_settings
A flat dict of model-specific physics/numerics defaults, mirroringForgeBlueprint.model_settings1:1 (each top-level key is a namelist section or a scalar namelist value, e.g.cppdefs,param,tides,marbl_bgc;gamma2,ubind). Every compile-time.j2template file listed undercode.templates_compile_time.filesmust have a corresponding top-level key here (e.g.cppdefs.opt.j2requires acppdefs:section) — this is enforced by aModelSpecvalidator. Many fields within these sections are still overwritten by the resolver at build time from Domain/Forcing/Output selections (e.g.param’s grid-partitioning fields,cppdefs.obc_*/marbl/tides,tides.ntides); they’re included inmodel.yamlonly where the other fields in that same section are real, model-level defaults.
You can add new models by creating a new directory under cstar_forge/catalog/ModelSpec/<model>/ containing
a model.yaml with the schema above.