esg_grid
The uw mode for configuring and running the regional_esg_grid component.
uw esg_grid --help
usage: uw esg_grid [-h] [--version] TASK ...
Execute esg_grid tasks
Optional arguments:
-h, --help
Show help and exit
--version
Show version info and exit
Positional arguments:
TASK
namelist_file
The namelist file
provisioned_run_directory
Run directory provisioned with all required content
run
A run
runscript
The runscript
validate
Validate the UW driver config
All tasks take the same arguments. For example:
uw esg_grid run --help
usage: uw esg_grid run [-h] [--version] [--config-file PATH] [--batch]
[--dry-run] [--graph-file PATH]
[--key-path KEY[.KEY...]] [--quiet] [--verbose]
A run
Optional arguments:
-h, --help
Show help and exit
--version
Show version info and exit
--config-file PATH, -c PATH
Path to UW YAML config file (default: read from stdin)
--batch
Submit run to batch scheduler
--dry-run
Only log info, making no changes
--graph-file PATH
Path to Graphviz DOT output [experimental]
--key-path KEY[.KEY...]
Dot-separated path of keys leading through the config to the driver's
configuration block
--quiet, -q
Print no logging messages
--verbose, -v
Print all logging messages
Examples
The examples use a configuration file named config.yaml with contents similar to:
esg_grid:
execution:
batchargs:
nodes: 1
stdout: /path/to/runscript.out
walltime: "08:00:00"
executable: /path/to/esg_grid
namelist:
base_file: /path/to/base_file
update_values:
regional_grid_nml:
delx: 0.11
dely: 0.11
lx: -214
ly: -128
pazi: 0.0
plat: 38.5
plon: -97.5
validate: true
run_dir: /path/to/esg_grid
platform:
account: me
scheduler: slurm
Its contents are described in depth in section esg_grid.
Run
esg_gridon an interactive node$ uw esg_grid run --config-file config.yaml
The driver creates a
runscript.esg_gridfile in the directory specified byrun_dir:in the config and runs it, executingesg_grid.Run
esg_gridvia a batch job$ uw esg_grid run --config-file config.yaml --batch
The driver creates a runscript.esg_grid file in the directory specified by run_dir: in the config and submits it to the batch system. Running with --batch requires a correctly configured platform: block in config.yaml, as well as appropriate settings in the execution: block under esg_grid:.
Specifying the
--dry-runflag results in the driver logging messages about actions it would have taken, without actually taking any.$ uw esg_grid run --config-file config.yaml --batch --dry-run
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.The
runtask depends on the other available tasks and executes them as prerequisites. It is possible to execute any task directly, which entails execution of any of its dependencies. For example, to create anesg_gridrun directory provisioned with all the files, directories, symlinks, etc. required per the configuration file:$ uw esg_grid provisioned_run_directory --config-file config.yaml --batch