Skip to content

Commit

Permalink
table with default values of KPP commands, and more
Browse files Browse the repository at this point in the history
  • Loading branch information
RolfSander committed May 20, 2022
1 parent 73501d9 commit 3a09137
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 52 deletions.
37 changes: 19 additions & 18 deletions docs/source/tech_info/06_info_for_kpp_developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,39 +280,40 @@ To add a new KPP command, the source code has to be edited at several
locations. A short summary is presented here, using the new command as
an example:

- Add to several files in the directory:
* Add the new command to several files in the :file:`src/` directory:

- :file:`scan.h`: add :code:`void CmdNEWCMD( char *cmd );`

.. code-block:: C
- :file:`scan.l`: add :code:`{ "NEWCMD", PRM_STATE, NEWCMD },`

void CmdNEWCMD( char *cmd );
- : ``{ "NEWCMD", PRM_STATE, NEWCMD },``
- :file:`scanner.c`: add :code:`void CmdNEWCMD( char *cmd )`

- : ``void CmdNEWCMD( char *cmd )``
- :file:`scan.y`:

- :
- add :code:`%token NEWCMD`

- ``%token NEWCMD``
- add :code:`| NEWCMD PARAMETER`

- ``NEWCMD PARAMETER``
- add :code:`{ CmdNEWCMD( $2 ); }`

- ``{ CmdNEWCMD( $2 ); }``
* Add :ref:`ci-tests`:

- Add a :ref:`ci-tests`:
- Create a new directory :file:`ci-tests/ros_newcmd/ros_newcmd.kpp`

- Create a new directory
- Add new :ref:`ci-tests` to the :file:`ci-tests` folder and
update the scripts in the :file:`.ci-pipelines` folder.

- Add new :ref:`ci-tests` to the :file:`ci-tests` folder and
update the scripts in :file:`.ci-pipelines` folder.
* Other:

- Other:
- explain in user manual :file:`manual/kpp_UserManual.tex`:

- Explain in user manual:
- add to table :code:`tab:commands`

- Add to table
- add a section :code:`sec:command-newcmd`

- Add a section
- add to BNF description table :code:`sec:bnf`

- Add to BNF description table
- add to :file:`site-lisp/kpp.el`

.. _ci-tests:

Expand Down
26 changes: 20 additions & 6 deletions docs/source/tech_info/07_numerical_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ Fully implicit 3-stage Runge-Kutta methods. Several variants are available:

RADAU5
------
**Integrator files:** :file:`int/kpp_radau5.f90`
**Integrator files:** :file:`int/radau5.f90`

This Runge-Kutta method of order 5 based on RADAU-IIA quadrature
is stiffly accurate. The KPP implementation follows the original
Expand All @@ -396,14 +396,14 @@ variants are available:

SDIRK4
------
**Integrator file:** :file:`int/kpp_sdirk4.f90`
**Integrator file:** :file:`int/sdirk4.f90`

SDIRK4 is an L-stable, singly-diagonally-implicit Runge-Kutta method
of order 4. The implementation is based on :cite:`1991:Hairer_and_Wanner`.

SEULEX
------
**Integrator file:** :file:`int/kpp_seulex.f90`
**Integrator file:** :file:`int/seulex.f90`

SEULEX is a variable order stiff extrapolation code able to produce
highly accurate solutions. The KPP implementation is based on the
Expand Down Expand Up @@ -484,21 +484,35 @@ implementations of BDF methods, described in the following sections:

LSODE
-----
**Integrator file:** :file:`int/kpp_lsode.f90`
**Integrator file:** :file:`int/lsode.f90`

LSODE, the Livermore ODE solver :cite:`1993:LSODE`, implements backward
differentiation formula (BDF) methods for stiff problems. LSODE has
been translated to Fortran90 for the incorporation into the KPP library.

VODE
-----
----

**Integrator file:** :file:`int/kpp_dvode.f90`
**Integrator file:** :file:`int/dvode.f90`

VODE :cite:`1989:VODE` uses another formulation of backward
differentiation formulas. The version of VODE present in the KPP
library uses directly the KPP sparse linear algebra routines.

BEULER
------

**Integrator file:** :file:`int/beuler.f90`

=====
Other
=====

FEULER
------

**Integrator file:** :file:`int/feuler.f90`

.. _integrator-input-output:

=============================
Expand Down
81 changes: 66 additions & 15 deletions docs/source/using_kpp/04_input_for_kpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,61 @@ included in the transport calculations.
KPP commands
============

A command begins on a new line with a :code:`#` sign, followed by a
A KPP command begins on a new line with a :code:`#` sign, followed by a
command name and one or more parameters. Details about each command
are given in the following subsections.

.. table::
:align: center

+--------------------------+-----------------------+
| KPP command | default value |
+==========================+=======================+
| :command:`#CHECKALL` | |
+--------------------------+-----------------------+
| :command:`#DECLARE` | :code:`SYMBOL` |
+--------------------------+-----------------------+
| :command:`#DOUBLE` | :code:`ON` |
+--------------------------+-----------------------+
| :command:`#DRIVER` | :code:`none` |
+--------------------------+-----------------------+
| :command:`#DUMMYINDEX` | :code:`OFF` |
+--------------------------+-----------------------+
| :command:`#EQNTAGS` | :code:`OFF` |
+--------------------------+-----------------------+
| :command:`#FUNCTION` | :code:`AGGREGATE` |
+--------------------------+-----------------------+
| :command:`#HESSIAN` | :code:`ON` |
+--------------------------+-----------------------+
| :command:`#INCLUDE` | |
+--------------------------+-----------------------+
| :command:`#INTEGRATOR` | |
+--------------------------+-----------------------+
| :command:`#INTFILE` | |
+--------------------------+-----------------------+
| :command:`#JACOBIAN` | :code:`SPARSE_LU_ROW` |
+--------------------------+-----------------------+
| :command:`#LANGUAGE` | |
+--------------------------+-----------------------+
| :command:`#LOOKATALL` | |
+--------------------------+-----------------------+
| :command:`#MEX` | :code:`ON` |
+--------------------------+-----------------------+
| :command:`#MINVERSION` | |
+--------------------------+-----------------------+
| :command:`#MODEL` | |
+--------------------------+-----------------------+
| :command:`#REORDER` | :code:`ON` |
+--------------------------+-----------------------+
| :command:`#STOCHASTIC` | :code:`OFF` |
+--------------------------+-----------------------+
| :command:`#STOICMAT` | :code:`ON` |
+--------------------------+-----------------------+
| :command:`#TRANSPORTALL` | |
+--------------------------+-----------------------+
| :command:`#UPPERCASEF90` | :code:`OFF` |
+--------------------------+-----------------------+

.. _declare-cmd:

#DECLARE
Expand Down Expand Up @@ -544,8 +595,18 @@ is similar to:
#INCLUDE $KPP_HOME/int/integrator-name.def
If the :command:`#INTEGRATOR` the command occurs twice, the second
replaces the first.
The :command:`#INTEGRATOR` command allows the use of different
integration techniques on the same model. If it occurs twice, the second
replaces the first. Normally, KPP tries to find the selected integrator
files in the directory :file:`$KPP_HOME/int/`. However, if the supplied
file name contains a slash, it is assumed to be absolute. To access an
integrator in the current directory, the prefix :file:`./` can be used,
e.g.:

.. code-block:: console
#INTEGRATOR ./mydeffile
#INTFILE ./myintegrator
.. _intfile-cmd:

Expand All @@ -561,22 +622,12 @@ replaces the first.
The integrator definition file selects an integrator file with
:command:`#INTFILE` and also defines some suitable options for it. The
:command:`#INTFILE` command selects the file that contains the integrator
routine. This command allows the use of different integration
techniques on the same model. The parameter of the
routine. The parameter of the
command is a file name, without suffix. The appropriate suffix
(:code:`.f90`, :code:`.F90`, :code:`.c`, or :code:`.m` is appended and
the result selects the file from which the integrator
is taken. This file will be copied into the code file in the appropriate
place. All integrators have to conform to the same specific calling
sequence. Normally, KPP tries to find the selected integrator file in
the directory :file:`$KPP_HOME/int/`. However, if the supplied file name
contains a slash, it is assumed to be absolute. To access an integrator
in the current directory, the prefix :file:`./` can be used, e.g.:

.. code-block:: console
#INTEGRATOR ./mydeffile
#INTFILE ./myintegrator
place.

.. _jacobian-cmd:

Expand Down
24 changes: 11 additions & 13 deletions docs/source/using_kpp/05_output_from_kpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ is contained in the following sections.
are only produced under certain circumstances.

All subroutines and functions, global parameters, variables, and
sparsity data structures are encapsulated in modules. There is
exactly one module in each file, and the name of the module is
identical to the file name but without the suffix :code:`.f90` or
:code:`.F90`. `Figure 1 (above) <The Fortran90 code_>`_ shows how these modules
are related to each other. The generated code is consistent with the
Fortran90 standard. It will not exceed the maximum number of 39 continuation
lines. If KPP cannot properly split an expression to keep the number
of continuation lines below the threshold then it will generate a
warning message pointing to the location of this expression.
sparsity data structures are encapsulated in modules. There is exactly
one module in each file, and the name of the module is identical to the
file name but without the suffix :code:`.f90` or :code:`.F90`. `Figure 1
(above) <The Fortran90 code_>`_ shows how these modules are related to
each other. The generated code is consistent with the Fortran90
standard. It may, however, exceed the official maximum number of 39
continuation lines.

.. tip::

Expand Down Expand Up @@ -182,7 +180,7 @@ initialized in :file:`ROOT_Parameters.f90` (or :file:`.F90`).
+----------------+---------------------------------------------+--------+
| Parameter | Represents | Value |
+================+=============================================+========+
| ``NSPEC`` | No. chemical species (``NVAR``+``NFIX``) | 7 |
| ``NSPEC`` | No. chemical species (:code:`NVAR+NFIX`) | 7 |
+----------------+---------------------------------------------+--------+
| ``NVAR`` | No. variable species | 5 |
+----------------+---------------------------------------------+--------+
Expand All @@ -205,9 +203,9 @@ initialized in :file:`ROOT_Parameters.f90` (or :file:`.F90`).
| ``indf_spc`` | Index of fixed species *spc* in :code:`FIX` | |
+----------------+---------------------------------------------+--------+

NOTE: Values listed the 3rd column of Table 5 are from the
:command:`small_strato` mechanism
(cf. :ref:`running-kpp-with-an-example-mechanism`).
NOTE: Values listed the 3rd column of Table 5 are from the
:command:`small_strato` mechanism
(cf. :ref:`running-kpp-with-an-example-mechanism`).

KPP orders the variable species such that the sparsity pattern of the
Jacobian is maintained after an LU decomposition. For our example there
Expand Down

0 comments on commit 3a09137

Please sign in to comment.