fre.pp.configure_script_yaml module

Script creates the rose-suite file for the workflow from the pp yaml.

fre.pp.configure_script_yaml.quote_rose_values(value: str) str

rose-suite.conf template variables must be quoted unless they are boolean or a list, in which case do not quote them.

Parameters:

value (str) – rose-suite configuration value

Returns:

quoted rose-suite configuration value

Return type:

str

fre.pp.configure_script_yaml.rose_init(experiment: str, platform: str, target: str) metomi.rose.config.ConfigNode

Initializes the rose suite configuration.

Parameters:
  • experiment (str) – Name of post-processing experiment, default None

  • platform (str) – Name of platform to use, default None

  • target (str) – Name of target ([prod/debug/repro]-openmp)

Returns:

  • rose_suite: class within Rose python library; represents

    elements of the rose-suite configuration

Return type:

  • rose_suite: metomi.rose.config.ConfigNode class

fre.pp.configure_script_yaml.set_rose_suite(yamlfile: dict, rose_suite: metomi.rose.config.ConfigNode) None

Sets items in the rose suite configuration.

Parameters:
  • yamlfile (dict) – Model, settings, pp, and analysis yaml information combined into a dictionary

  • rose_suite (metomi.rose.config.ConfigNode; class) – class within Rose python library; represents elements of the rose-suite configuration

Raises:

ValueError

  • if the postproces section of the yaml is not defined

  • if more than 1 pre-analysis script is defined

Returns:

None

Return type:

None

fre.pp.configure_script_yaml.validate_yaml(yamlfile: dict) None

Validate the format of the yaml file based on the schema.json in gfdl_msd_schemas

Parameters:

yamlfile (dict) – Model, settings, pp, and analysis yaml information combined into a dictionary

Raises:

ValueError

  • if gfdl_mdf_schema path is not valid

  • combined yaml is not valid

  • unclear error in validation

Returns:

None

Return type:

None

fre.pp.configure_script_yaml.yaml_info(yamlfile: str = None, experiment: str = None, platform: str = None, target: str = None) None

Using a valid pp.yaml, the rose-suite configuration file is created in the cylc-src directory. The pp.yaml is also copied to the cylc-src directory.

Parameters:
  • yamlfile (str) – Path to YAML file used for experiment configuration, default None

  • experiment (str) – One of the postprocessing experiment names from the yaml displayed by fre list exps -y $yamlfile (e.g. c96L65_am5f4b4r0_amip), default None

  • platform (str) – The location + compiler that was used to run the model (e.g. gfdl.ncrc5-deploy), default None

  • target (str) – Options used for the model compiler (e.g. prod-openmp), default None

Raises:

ValueError – if experiment, platform, target or yamlfile is None

Returns:

None

Return type:

None

Note

In this function, outfile is defined and used with consolidate_yamls. This will create a final, combined yaml file in the ~/cylc-src/[workflow_id] directory. Additionally, rose-suite information is being dumped into its own configuration file in the cylc-src directory.