Template plugin for BCs BCs/template#
Description#
Template/skeleton plugin for boundary-condition (BC) field data streams.
This is not a working data source: fetch, get_domain and read
are annotated stubs (print(...) placeholders and XXX comments) meant
to be copied and filled in when implementing a new BC field plugin. They
illustrate, respectively, how to build the list_dates/list_files
dictionaries expected by pyCIF, how to derive a Setup-based
domain from a reference file, and how to return a 4-dimensional
(time, lev, lat, lon) xarray.DataArray.
When writing a new plugin from this template, replace this description with information relevant to the actual data source: type of files treated (including the format of names and the shape of the data), time resolution, and any specific treatment or limitation that prevents the plugin from working with another type of file.
YAML arguments#
The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:
Optional arguments#
- dir : str, optional, default “”
Path to the corresponding component. This value is used if not provided in parameters
- file : str, optional, default “”
File format in the given directory. This value is used if not provided in parameters
- varname : str, optional, default “”
Variable name to use to read data filesinstead of the parameter name if different to the parameter name
- file_freq : str, optional, default “”
Temporal frequency to fetch files
- split_freq : str, optional
Re-bucket this tracer’s fetched dates/files onto a fixed pandas-frequency grid (e.g.
'1D','1MS','1YS'), independently of the native frequency the files were found at (file_freq). This fixes the sub-simulation boundaries thatfromcontrolinherits for this tracer. For minimal memory usage, match it to the consuming model’s own periodicity: a finer value costs an extratime_interpolationbridge for no memory benefit, while a coarser value keeps the tracer’s data resident in memory across every one of the model’s sub-simulations it spans. See the ‘Splitting the temporal grid’ section on the observation operator page for the full mechanism and worked examples.
- dummy_arg : str, optional, default “let’s say it’s not mandatory”
document here the argument
YAML template#
Please find below a template for a YAML configuration:
1field:
2 plugin:
3 name: BCs
4 version: template
5 type: field
6
7 # Optional arguments
8 dir: XXXXX # str
9 file: XXXXX # str
10 varname: XXXXX # str
11 file_freq: XXXXX # str
12 split_freq: XXXXX # str
13 dummy_arg: XXXXX # str
See also