How to add a recipe to the |RTW| ================================ .. include:: common.txt Overview -------- To add a recipe to the |RTW| you will: * Run the recipe at your site * Note the actual duration and memory usage * Edit your site's recipe file * Create the recipe's KGOs * Request a review The recipe will then run at your site whenever the |RTW| is run. Preparation ----------- #. Open a `new ESMValTool issue`_ on GitHub. Assign yourself to the issue and add the ``Recipe Test Workflow (RTW)`` label. `ESMValTool issue #3663`_ provides an example. #. Create a branch. #. Run the recipe: * with the latest version of ESMValTool * on the compute server you use at your site .. hint:: Your compute server is defined in the ``site//runtime.cylc`` file as follows:: [[COMPUTE]] platform = #. Obtain the actual duration and memory usage of the recipe. This can be found either in the message printed to screen, or at the end of the ``run/main_log.txt`` file in the recipe output directory. The relevant lines will look something like:: YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Time for running the recipe was: 0:02:13.334742 YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Maximum memory used (estimate): 2.4 GB [...] YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Run was successful Adding the recipe ----------------- #. Add the recipe in alphabetical order to either ``FAST_RECIPES`` or ``MEDIUM_RECIPES`` in the ``site//recipes.jinja`` file. It should look something like:: { 'recipe_path': 'recipe_a_fast_recipe', 'actual': '2m13s, 2.4 GB on YYYY-MM-DD', 'max_time': 'PT3M', 'max_memory': '3G', } .. important:: Add the recipe to ``FAST_RECIPES`` if it takes *less* than 10 mins to run at your site. Add the recipe to ``MEDIUM_RECIPES`` if it takes *more* than 10 mins. .. hint:: The :ref:`site_recipes_file` file provides more information. .. hint:: Set the ``max_time`` to 10-20% more than the actual duration. For actual durations of up to ``1m45s``, set ``max_time`` to ``PT2M`` (2 minutes). .. hint:: Try not to regularly waste more than 500 MiB in memory usage. Typically, rounding the actual memory usage up to the nearest integer is acceptable. Create the |KGOs| ----------------- #. Run the |RTW|, as detailed in the :ref:`quick_start_guide`; it is expected that the ``compare`` task will fail. .. important:: The ``compare`` task fails because the |KGOs| for the recipe do not yet exist. This run of the |RTW| will generate the outputs that will be used as |KGOs|. #. Recursively copy the recipe output directory ``recipe___