

.. _examples.academic.fill:

.. include:: ../../../examples/academic/fill/README.rst

Path: :file:`examples/academic/fill`.

Configuring
-----------

.. literalinclude:: ../../../examples/academic/fill/workflow.cfg
    :language: ini
    :caption: :file:`workflow.cfg`

.. literalinclude:: ../../../examples/academic/fill/tasks.cfg
    :language: ini
    :caption: :file:`tasks.cfg`


Each subsection of the ``fill`` section  (e.g., ``model_config``, ``param_file``) defines which templates to fill:

- ``template``: The Jinja2 template file to use (located in the templates directory)
- ``destination``: Where to write the filled file (supports template variables)

The filled files will be generated in the :file:`output/` directory with
cycle-specific names like :file:`config_2020-01-01.nml`.



Using the fill CLI command
---------------------------
You can also fill templates manually using the ``woom fill`` command:

.. code-block:: bash

    woom fill model.nml.j2 output/config.nml --task-name hydro_model --cycle 2020-01-01

This is useful for testing templates or generating one-off configuration files.

See also: :ref:`cli.woom.fill`.

Running
-------

Overview
~~~~~~~~
Let's have an overview of stages before running the workflow.

.. command-output:: woom show overview
    :cwd: ../../../examples/academic/fill

Dry run
~~~~~~~
Now let's run the workflow in test (dry) and debug modes.

.. command-output:: woom run --log-no-color --log-level debug --dry-run
    :cwd: ../../../examples/academic/fill


Normal run
~~~~~~~~~~
And finally in run it.

.. command-output:: woom run --log-no-color
    :cwd: ../../../examples/academic/fill

Check status
~~~~~~~~~~~~
Check what is running or finished.

.. command-output:: woom show status
    :cwd: ../../../examples/academic/fill

Show run directories
~~~~~~~~~~~~~~~~~~~~
Show where tasks were executed.

.. command-output:: woom show run_dirs
    :cwd: ../../../examples/academic/fill



