fre.cmor.cmor_yamler module
this module is for ‘fre cmor yaml’ calls, driving and steering the cmor_run_subtool via a model-yaml file holding configuration information on e.g. target experiments
- fre.cmor.cmor_yamler.check_path_existence(some_path)
simple function checking for pathlib.Path existence, raising a FileNotFoundError if needed Args:
some_path (str), required, a string representing a path. can be relative or absolute
- fre.cmor.cmor_yamler.cmor_yaml_subtool(yamlfile=None, exp_name=None, platform=None, target=None, output=None, opt_var_name=None, run_one_mode=False, dry_run_mode=False, start=None, stop=None)
A routine that cmorizes targets based on configuration stored in the model yaml. The model yaml points to various cmor-yaml configurations. The two levels of information are combined, their fields are parsed to de-reference anchors and call fre’s internal yaml constructor functions.
yamlfile (required): string or Path to a model-yaml exp_name (required): string representing an experiment name. it must be present in the list of
experiments within the targeted yamlfile
platform (required): string representing platform target (e.g. ncrc4.intel) target (required): string representing compilation target (e.g. prod-openmp) output (optional): string or Path representing target location for yamlfile output if desired opt_var_name (optional): string, specify a variable name to specifically process only filenames matching
that variable name. I.e., this string help target local_vars, not target_vars.
run_one_mode (optional): boolean, when True, will only process one of targeted files, then exit. start, stop: string, optional arguments, strings of four integers representing years (YYYY).
- fre.cmor.cmor_yamler.conv_mip_to_bronx_freq(cmor_table_freq)
uses a look up table to convert a given frequency in a MIP table, to that same frequency under FRE-bronx convention instead Args:
cmor_table_freq (str), required, a frequency string read from a MIP table, subject to a controlled vocabulary.
- fre.cmor.cmor_yamler.get_bronx_freq_from_mip_table(json_table_config)
checks one of the variable fields within a cmip cmor table for the frequency of the data the table describes takes in a path to a json cmip cmor table file, and output a string corresponding to a FREbronx style frequency Args:
json_table_config (str), required, a string representing a path to a json MIP table holding metadata under variable names
- fre.cmor.cmor_yamler.iso_to_bronx_chunk(cmor_chunk_in)
converts a string representing a datetime chunk in ISO’s convention (e.g. ‘P5Y’), to a string representing the same thing in FRE-bronx’s convention Args:
cmor_chunk_in (str), required, ISO 8601 formatted string representing a datetime interval