fremor.cmor_yamler module
fremor yaml: YAML-Driven CMORization Workhorse
This module powers the fremor yaml command, steering the CMORization workflow by parsing a
self-contained CMOR YAML file, resolving required metadata and paths, and orchestrating calls to
cmor_run_subtool for each target variable/component.
Functions
cmor_yaml_subtool(...)
Note
“yamler” is a portmanteau of “yaml” and “reader”.
- fremor.cmor_yamler.cmor_yaml_subtool(yamlfile: str = None, opt_var_name: str | None = None, run_one_mode: bool = False, dry_run_mode: bool = False, start: str | None = None, stop: str | None = None, calendar_type: str | None = None, print_cli_call: bool = True)
Main driver for CMORization using self-contained CMOR YAML configuration files. This routine parses the CMOR YAML, resolves and checks all required paths and metadata, and orchestrates calls to cmor_run_subtool for each table/component/variable defined in the configuration.
- Parameters:
yamlfile (str) – Path to a self-contained CMOR YAML file.
opt_var_name (str, optional) – If specified, process only files matching this variable name.
run_one_mode (bool) – If True, process only one file and exit.
dry_run_mode (bool) – If True, print configuration and actions without executing cmor_run_subtool.
start (str, optional) – Four-digit year (YYYY) indicating start of date range to process.
stop (str, optional) – Four-digit year (YYYY) indicating end of date range to process.
calendar_type (str, optional) – CF-compliant calendar type.
print_cli_call (bool) – When True and dry_run_mode is enabled, print the equivalent
fremor runCLI invocation; when False, print the Pythoncmor_run_subtool(...)call instead.
- Raises:
FileNotFoundError – If required paths do not exist.
OSError – If output directories cannot be created.
ValueError – If required configuration is missing or inconsistent.
- Returns:
None
- Return type:
None
Note
Reads CMOR YAML and JSON configuration.
Note
Performs path, frequency, and gridding checks.
Note
Delegates actual CMORization to cmor_run_subtool, except in dry-run mode.
Note
All actions and key decisions are logged.