newfluxdata.rst 2.7 KB
Newer Older
1
####################################################################################
2
How to add a new type of flux data to be processed by the CIF into a model's inputs
3
####################################################################################
4
5
6
7

.. role:: bash(code)
   :language: bash

8
0. .. include:: ../newBCdata/knownplugin.rst
9
10


11
12
1. In directory :bash:`plugins/fluxes`, copy the directory containing the template for a flux plugin :bash:`flux_plugin_template` in the directory for your new plugin. 

13
   .. include:: ../newBCdata/register.rst
14
15
16
17
18


2. Modify the yaml file to use the new plugin: the minimum input arguments are :bash:`dir`, :bash:`file`, :bash:`varname` and :bash:`unit_conversion`. The default space and time interpolations will be applied (see XXXX doc sur premiere simu directe avec exmeple yaml quand mise a jourXXXXX). 

.. code-block:: yaml
19

20
21
22
23
24
25
26
27
28
29
30
 components:
    fluxes:
      plugin:
         name: fluxes
         version: template
         type: fluxes
      dir: dir_with_original_files/
      file: file_with_new_fluxes_to_use_as_inputs
      varname: NAMEORIG
      unit_conversion:
            scale: 1.
31

32
3. .. include:: ../newBCdata/devplugin.rst
33

34
XXXXXXX what about the input arguements? Ils demandent une partie dediee!?XXXXXXXXXX
35

36
4. Document the new plugin:
37
   
38
39
40
   a) .. include:: ../newBCdata/readme.rst 


Antoine Berchet's avatar
Antoine Berchet committed
41
   b) create the rst file that contains the automatic documentation in  docs/source/documentation/plugins/fluxes/. Please provide it with a self-explaining name. Example for the template: file fluxes_template.rst reads
42
43
44
45
46
47
48
49
50
51
52
53

     .. code-block:: rest

       .. role:: bash(code)
          :language: bash

       ###########################
       Template plugin for fluxes
       ###########################

       .. automodule:: pycif.plugins.fluxes.flux_plugin_template

Antoine Berchet's avatar
Antoine Berchet committed
54
   c) add the reference to the rst file in docs/source/documentation/plugins/fluxes/index.rst:
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

     .. code-block:: rest

        ####################
        Fluxes :bash:`fluxes`
        ####################

        Available Fluxes
        =========================

        The following :bash:`fluxes` are implemented in pyCIF:

        .. toctree::
             :maxdepth: 3
            
             fluxes_template
             dummy_nc
             dummy_txt
             edgar_v5
             flexpart
             chimere
             lmdz_bin
             lmdz_sflx

Antoine Berchet's avatar
Antoine Berchet committed
79
   d) built the documentation (:bash:`make html` in docs/) and check that the link to the new plugin appears in the documentation at file:///your_path/cif/docs/build/html/documentation/plugins/index.html and that the section "doc" of the input arguments is correctly displayed at file:///your_path/cif/docs/build/html/documentation/plugins/fluxes/the_new_plugin.html
80