Template for model implementation template/std

Template for model implementation template/std#

Description#

Template plugin for implementing a new model in CIF.

This is a skeleton plugin that serves as the starting point for integrating a new atmospheric model into the Community Inversion Framework. It provides all the required entry points (run, ini_mapper, ini_periods, native2inputs, native2inputs_adj, outputs2native, outputs2native_adj, make_auxiliary, compile) with minimal implementations that developers can extend.

Usage#

Copy this directory and rename it to your model name, then implement the functions following the interface contract described in the models plugin documentation.

The set_requirements function in this template demonstrates how to conditionally include domain and chemistry requirements based on YAML configuration flags (require_domain, require_chemistry).

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#

autoflush : bool, optional, default False

Cleans big temporary files when the simulation is done. Triggers the function flushrun of the model if available

ensrf_restart_file : str, optional

Use in EnSRF mode to point at relevant restart file

ensrf_datei : str, optional

New start date to use in EnSRF

ensrf_same_restart : bool, optional

Use in EnSRF mode to check if same restart

require_domain : bool, optional, default False

Test initializing the template with a domain

require_chemistry : bool, optional, default False

Test initializing the template with a chemical scheme

empty_mapper : bool, optional, default True

Initializes an empty mapper

only_outputs : bool, optional, default False

Initializes a mapper with only concentration outputs

output_resolution : str, optional, default “1h”

Temporal resolution of outputs

input_resolution : str, optional, default “1h”

Temporal resolution of inputs

include_fluxes : bool, optional, default False

Force the preparation of fluxes prior to running the model

YAML template#

Please find below a template for a YAML configuration:

 1model:
 2  plugin:
 3    name: template
 4    version: std
 5    type: model
 6
 7  # Optional arguments
 8  autoflush: XXXXX  # bool
 9  ensrf_restart_file: XXXXX  # str
10  ensrf_datei: XXXXX  # str
11  ensrf_same_restart: XXXXX  # bool
12  require_domain: XXXXX  # bool
13  require_chemistry: XXXXX  # bool
14  empty_mapper: XXXXX  # bool
15  only_outputs: XXXXX  # bool
16  output_resolution: XXXXX  # str
17  input_resolution: XXXXX  # str
18  include_fluxes: XXXXX  # bool