chgres_cube
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 chgres_cube component.
uw chgres_cube --help
usage: uw chgres_cube [-h] [--version] TASK ...
Execute chgres_cube tasks
Optional arguments:
-h, --help
Show help and exit
--version
Show version info and exit
Positional arguments:
TASK
namelist_file
The namelist file
provisioned_rundir
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 chgres_cube run --help
usage: uw chgres_cube run --cycle CYCLE [-h] [--version] [--config-file PATH]
[--batch] [--dry-run] [--graph-file PATH]
[--key-path KEY[.KEY...]] [--quiet] [--verbose]
A run
Required arguments:
--cycle CYCLE
The cycle in ISO8601 format (e.g. 2024-05-23T18)
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 content similar to:
chgres_cube:
execution:
executable: chgres_cube
mpiargs:
- "--export=NONE"
mpicmd: srun
threads: 1
namelist:
update_values:
config:
atm_files_input_grid: atm.t{{cycle.strftime('%H') }}z.nc
convert_atm: true
convert_nst: true
convert_sfc: true
cycle_day: !int "{{ cycle.strftime('%d') }}"
cycle_hour: !int "{{ cycle.strftime('%H') }}"
cycle_mon: !int "{{ cycle.strftime('%m') }}"
data_dir_input_grid: /path/to/data/{{ cycle.strftime('%Y%M%d%H') }}
fix_dir_target_grid: /path/to/fixdir
grib2_file_input_grid: a.file.gb2
mosaic_file_target_grid: /path/to/mosaic/C432.mosaic.halo4.nc
orog_files_target_grid: /path/to/orog/C432.oro_data.tile7.halo4.nc
sfc_files_input_grid: sfc.t{{cycle.strftime('%H') }}z.nc
varmap_file: /path/to/varmap_table
vcoord_file_target_grid: /path/to/global_hyblev.l65.txt
validate: true
rundir: /path/to/dir
platform:
account: me
scheduler: slurm
Its contents are described in depth in section chgres_cube. Each of the values in the chgres_cube YAML may contain Jinja2 variables/expressions using a cycle variable, which is a Python datetime object corresponding to the FV3 cycle being run.
Run
chgres_cubeon an interactive node$ uw chgres_cube run --config-file config.yaml --cycle 2023-12-15T18
The driver creates a
runscript.chgres_cubefile in the directory specified byrundir:in the config and runs it, executingchgres_cube.Run
chgres_cubevia a batch job$ uw chgres_cube run --config-file config.yaml --cycle 2023-12-15T18 --batch
The driver creates a
runscript.chgres_cubefile in the directory specified byrundir:in the config and submits it to the batch system. Running with--batchrequires a correctly configuredplatform:block inconfig.yaml, as well as appropriate settings in theexecution:block underchgres_cube:.Specifying the
--dry-runflag results in the driver logging messages about actions it would have taken, without actually taking any.$ uw chgres_cube run --config-file config.yaml --cycle 2023-12-15T18 --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 achgres_cuberun directory provisioned with all the files, directories, symlinks, etc. required per the configuration file:$ uw chgres_cube provisioned_rundir --config-file config.yaml --cycle 2023-12-15T18 --batch