ww3
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 Wave Watch III component.
uw ww3 --help
usage: uw ww3 [-h] [--version] [--show-schema] TASK ...
Execute ww3 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
restart_directory
The restart directory
validate
Validate the UW driver config
All tasks take the same arguments. For example:
uw ww3 --help
usage: uw ww3 [-h] [--version] [--show-schema] TASK ...
Execute ww3 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
restart_directory
The restart directory
validate
Validate the UW driver config
Examples
The examples use a configuration file named config.yaml with content similar to:
ww3:
namelist:
template_file: /path/to/ww3/ww3_shel.nml.IN
template_values:
input_forcing_winds: C
rundir: /path/to/run/dir
Its contents are described in depth in section ww3. A Python datetime object named cycle is available for use in Jinja2 variables/expressions in the config.
Create a provisioned run directory:
$ uw ww3 provisioned_rundir --config-file config.yaml --cycle 2024-10-21T12
Validate the config file:
$ uw ww3 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 ww3 --show-schema >schema head -n20 schema{ "properties": { "ww3": { "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.