upp

The uw mode for configuring and running the UPP component.

uw upp --help
usage: uw upp [-h] [--version] TASK ...

Execute upp tasks

Optional arguments:
  -h, --help
      Show help and exit
  --version
      Show version info and exit

Positional arguments:
  TASK
    files_copied
      Files copied for run
    files_linked
      Files linked for run
    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 upp run --help
usage: uw upp run --cycle CYCLE --leadtime LEADTIME [-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)
  --leadtime LEADTIME
      The leadtime as hours[:minutes[:seconds]]

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:

upp:
  execution:
    batchargs:
      export: NONE
      nodes: 1
      walltime: "00:05:00"
    envcmds:
      - module use /path/to/modulefiles
      - module load runtime-module
      - source /etc/profile.d/slurm.sh
    executable: /path/to/upp.x
    mpiargs:
      - "--ntasks $SLURM_CPUS_ON_NODE"
    mpicmd: srun
  files_to_copy:
    postxconfig-NT.txt: /path/to/postxconfig-NT.txt
  files_to_link:
    eta_micro_lookup.dat: /path/to/nam_micro_lookup.dat
    params_grib2_tbl_new: /path/to/params_grib2_tbl_new
  namelist:
    base_file: /path/to/base.nml
    update_values:
      model_inputs:
        datestr: "{{ (cycle + leadtime).strftime('%Y-%m-%d_%H:%M:%S') }}"
        filename: /path/to/dynf{{ '%03d' % (leadtime.total_seconds() / 3600) }}.nc
        filenameflux: /path/to/phyf{{ '%03d' % (leadtime.total_seconds() / 3600) }}.nc
        grib: grib2
        ioform: netcdf
        modelname: FV3R
      nampgb:
        kpo: 3
        numx: 1
        po:
          - 1000
          - 100
          - 1
    validate: true
  run_dir: /path/to/run
platform:
  account: me
  scheduler: slurm

Its contents are described in depth in section upp.

  • Run upp on an interactive node

    $ uw upp run --config-file config.yaml --cycle 2024-05-06T12 --leadtime 6
    

    The driver creates a runscript.upp file in the directory specified by run_dir: in the config and runs it, executing upp.

  • Run upp via a batch job

    $ uw upp run --config-file config.yaml --cycle 2024-05-06T12 --leadtime 6 --batch
    

    The driver creates a runscript.upp 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 upp:.

  • Specifying the --dry-run flag results in the driver logging messages about actions it would have taken, without actually taking any.

    $ uw upp run --config-file config.yaml --cycle 2024-05-06T12 --leadtime 6 --batch --dry-run
    
  • The --key-path option can be used to navigate from the top of the config to the driver’s configuration block. For example, specifying --key-path foo.bar with config

    foo:
      bar:
        driver:
          # driver config block
    

    is equivalent to using config

    driver:
      # driver config block
    

    without specifying --key-path.

  • The run task 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 an upp run directory provisioned with all the files, directories, symlinks, etc. required per the configuration file:

    $ uw upp provisioned_run_directory --config-file config.yaml --cycle 2024-05-06T12 --leadtime 6 --batch