schism
Note
The uwtools drivers are idempotent, meaning that actions they successfully complete during one invocation are not repeated in subsequent invocations. For example, an asset like a configuration file will not be recreated when the driver is run again, even if its UW YAML configuration changes. To force recreation, remove the asset(s) in question – up to and including the entire provisioned run directory – then re-run the driver, which will recreate any missing assets based on the current configuration.
The uw mode for configuring and running the SCHISM component.
uw schism --help
usage: uw schism [-h] [--version] [--show-schema] TASK ...
Execute schism tasks
Optional arguments:
-h, --help
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit
Positional arguments:
TASK
namelist_file
Render the namelist from the template file
provisioned_rundir
Run directory provisioned with all required content
validate
Validate the UW driver config
All tasks take the same arguments. For example:
uw schism --help
usage: uw schism [-h] [--version] [--show-schema] TASK ...
Execute schism tasks
Optional arguments:
-h, --help
Show help and exit
--version
Show version info and exit
--show-schema
Show driver schema and exit
Positional arguments:
TASK
namelist_file
Render the namelist from the template file
provisioned_rundir
Run directory provisioned with all required content
validate
Validate the UW driver config
Examples
The examples use a configuration file named config.yaml with content similar to:
schism:
namelist:
template_file: /path/to/schism/param.nml.IN
template_values:
dt: 100
rundir: /path/to/run/dir
Its contents are described in depth in section schism. A Python datetime object named cycle is available for use in Jinja2 variables/expressions in the config.
Create a provisioned run directory:
$ uw schism provisioned_rundir --config-file config.yaml --cycle 2024-10-21T12
Validate the config file:
$ uw schism validate --config-file config.yaml --cycle 2024-10-21T12
The
--key-pathoption can be used to navigate from the top of the config to the driver’s configuration block. For example, specifying--key-path foo.barwith configfoo: bar: driver: # driver config block
is equivalent to using config
driver: # driver config block
without specifying
--key-path.
Specifying the
--show-schemaflag, with no other options, prints the driver’s schema:uw schism --show-schema >schema head -n20 schema{ "properties": { "schism": { "additionalProperties": false, "properties": { "namelist": { "additionalProperties": false, "properties": { "template_file": { "type": "string" }, "template_values": { "minProperties": 1, "type": "object" } }, "required": [ "template_file" ], "type": "object"Use the
--schema-fileoption to specify a custom JSON Schema file with which to validate the driver config. A custom schema could range in complexity from the simplest, most permissive schema,{}, to one based on the internal schema shown by--show-schema.