mpas
Structured YAML to run MPAS is validated by JSON Schema and requires the mpas: block, described below. If mpas is to be run via a batch system, the platform: block, described here, is also required.
This driver receives a
cycleargument, which it makes available as a Pythondatetimeobject to Jinja2 when realizing its input config. This supports specification of cycle-specific values. For example, the key-value pairgfs.t{{ cycle.strftime('%H') }}z.atmanl.nc: /some/path/{{ cycle.strftime('%Y%m%d%H') }}/gfs.t{{ cycle.strftime('%H') }}z.atmanl.nc
would be rendered as
gfs.t18z.atmanl.nc: /some/path/2024021218/gfs.t18z.atmanl.nc
for cycle
2024-02-12T18.
Here is a prototype UW YAML mpas: block, explained in detail below:
mpas:
boundary_conditions:
interval_hours: 6
offset: 0
path: /path/to/boundary/conditions/directory
execution:
batchargs:
cores: 32
walltime: "01:30:00"
executable: atmosphere_model
mpiargs:
- "--ntasks={{ mpas['execution']['batchargs']['cores'] }}"
mpicmd: srun
files_to_copy:
conus.graph.info.part.32: /path/to/conus.graph.info.part.32
conus.init.nc: /path/to/conus.init.nc
stream_list.atmosphere.diagnostics: "{{ user.mpas_app }}/MPAS-Model/stream_list.atmosphere.diagnostics"
stream_list.atmosphere.output: "{{ user.mpas_app }}/MPAS-Model/stream_list.atmosphere.output"
stream_list.atmosphere.surface: "{{ user.mpas_app }}/MPAS-Model/stream_list.atmosphere.surface"
files_to_link:
CAM_ABS_DATA.DBL: "{{ user.mpas_app }}/MPAS-Model/CAM_ABS_DATA.DBL"
CAM_AEROPT_DATA.DBL: "{{ user.mpas_app }}/MPAS-Model/CAM_AEROPT_DATA.DBL"
GENPARM.TBL: "{{ user.mpas_app }}/MPAS-Model/GENPARM.TBL"
LANDUSE.TBL: "{{ user.mpas_app }}/MPAS-Model/LANDUSE.TBL"
OZONE_DAT.TBL: "{{ user.mpas_app }}/MPAS-Model/OZONE_DAT.TBL"
OZONE_LAT.TBL: "{{ user.mpas_app }}/MPAS-Model/OZONE_LAT.TBL"
OZONE_PLEV.TBL: "{{ user.mpas_app }}/MPAS-Model/OZONE_PLEV.TBL"
RRTMG_LW_DATA: "{{ user.mpas_app }}/MPAS-Model/RRTMG_LW_DATA"
RRTMG_LW_DATA.DBL: "{{ user.mpas_app }}/MPAS-Model/RRTMG_LW_DATA.DBL"
RRTMG_SW_DATA: "{{ user.mpas_app }}/MPAS-Model/RRTMG_SW_DATA"
RRTMG_SW_DATA.DBL: "{{ user.mpas_app }}/MPAS-Model/RRTMG_SW_DATA.DBL"
SOILPARM.TBL: "{{ user.mpas_app }}/MPAS-Model/SOILPARM.TBL"
VEGPARM.TBL: "{{ user.mpas_app }}/MPAS-Model/VEGPARM.TBL"
length: 6
namelist:
base_file: "{{ user.mpas_app }}/MPAS-Model/namelist.atmosphere"
update_values:
decomposition:
config_block_decomp_file_prefix: conus.graph.info.part.
limited_area:
config_apply_lbcs: true
nhyd_model:
config_dt: 60
validate: true
run_dir: /path/to/run/directory
streams:
path: "{{ user.mpas_app }}/MPAS-Model/streams.atmosphere"
values:
input_filename: conus.init.nc
input_interval: "06:00:00"
output_interval: "06:00:00"
platform:
account: me
scheduler: slurm
user:
mpas_app: /path/to/mpas/installation
An MPAS build provides prototype versions of certain required runtime files. Here, an arbitrarily named user: block defines an mpas_app variable, pointing to the directory where MPAS was installed, to reduce duplication in references to those files.
UW YAML for the mpas: Block
execution:
See this page for details.
boundary_conditions:
Describes the boundary condition files needed for the forecast. These will be the output from the init_atmosphere executable, which may be run using the mpas_init UW driver. Please see its documentation here.
interval_hours:
Frequency interval of the given files, in integer hours.
offset:
How many hours earlier the external model used for boundary conditions started compared to the desired forecast cycle, in integer hours.
path:
An absolute path to the MPAS-ready files to be used for initial and lateral boundary conditions input. The names of the files are specified in the MPAS streams.atmosphere XML file, and may be specified in the streams: values: block of the driver YAML.
length:
The length of the forecast in integer hours.
files_to_copy:
See this page for details.
To reduce duplication of information in this section, it may be helpful to template the file that depends on the number of cores being used to run the executable. For example, instead of:
mpas:
files_to_copy:
conus.graph.info.part.32: /path/to/conus.graph.info.part.32
Jinja2 expressions can be used to reference the number of cores used in execution:
mpas:
files_to_copy:
conus.graph.info.part.{{mpas.execution["batchargs"]["cores"]}}: /path/to/conus.graph.info.part.{{mpas.execution["batchargs"]["cores"]}}
files_to_link:
Identical to files_to_copy: except that symbolic links will be created in the run directory instead of copies.
namelist:
Supports base_file: and update_values: blocks (see the Updating Values for details).
Before the namelist file is written, its proposed content will be validated against the appropriate schema. This can be suppressed by setting validate: false in the UW YAML configuration block for the namelist.
run_dir:
The path to the run directory.
streams:
path:
The path to the base
streams.atmospherefile that comes from the MPAS build.values:
The set of key-value pairs that will render the appropriate XML entries in the streams input file.