Commit 5265616b authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Tuto on implementing flux plugin

parent 30a3f2bd
......@@ -5,7 +5,85 @@ How to add a new type of flux data to be processed by the CIF into a model's inp
.. role:: bash(code)
:language: bash
Pre-requisites
================
Before starting to implement a new flux plugin, you must have:
- a yaml file ready with a simulation that works with known plugins.
- a folder where the data you need to implement is stored
- basic information about the data you need to implement (licensing, format, etc.)
We help you below to navigate through different documentation pages to implement your plugin.
The main reference pages are :doc:`the datastream documentation page </documentation/plugins/datastreams/index>`
and :doc:`the flux template documentation page</documentation/plugins/datastreams/fluxes/flux_plugin_template>`.
Switch from working fluxes to the reference template
=====================================================
The :bash:`datavect` paragraph of your working yaml should look like that:
.. container:: toggle
.. container:: header
Show/Hide Code
.. code-block:: yaml
:linenos:
datavect:
plugin:
name: standard
version: std
components:
flux:
parameters:
CO2:
plugin:
name: CHIMERE
type: flux
version: AEMISSIONS
file_freq: 120H
dir: some_dir
file: some_file
1. follow the initial steps in :doc:`the flux template documentation page</documentation/plugins/datastreams/fluxes/flux_plugin_template>`
to initialize your new plugin and register it.
It includes copying the template folder to a new path and changing the variables
:bash:`_name`,:bash:`_fullname` and :bash:`_version` in the file :bash:`__init__.py`
2. update your Yaml to use the template flux (renamed with your preference). It should now look like that:
.. container:: toggle
.. container:: header
Show/Hide Code
.. code-block:: yaml
:linenos:
datavect:
plugin:
name: standard
version: std
components:
flux:
parameters:
CO2:
plugin:
name: your_new_name
type: flux
version: your_version
3. Test running again your test case. It should generate fluxes with random values
#####################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment