:orphan:

Fortran Examples
================

Examples for both Fortran 77 and Fortran 90.

.. caution::
    The Fortran interface is an experimental part of the Cantera API and may be changed
    or removed without notice.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Calculated Mach number vs. area for an isentropic flow. Relies on the wrapper functions defined in demo_ftnlib to call the Cantera C++ interface. See also the Python version of this problem in ../python/thermo/isentropic.">

.. only:: html

  .. image:: /examples/fortran/images/thumb/sphx_glr_isentropic_thumb.png
    :alt:

  :ref:`sphx_glr_examples_fortran_isentropic.f`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Isentropic flow</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This program uses functions defined in demo_ftnlib to create an ideal gas mixture and print some of its properties.">

.. only:: html

  .. image:: /examples/fortran/images/thumb/sphx_glr_f77_demo_thumb.png
    :alt:

  :ref:`sphx_glr_examples_fortran_f77_demo.f`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fortran 77 demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to implement subroutines that emulate those of the Chemkin CKLIB library.">

.. only:: html

  .. image:: /examples/fortran/images/thumb/sphx_glr_ctlib_thumb.png
    :alt:

  :ref:`sphx_glr_examples_fortran_ctlib.f`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">CKLIB emulation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This program illustrates using Cantera in Fortran 90 to compute thermodynamic, kinetic, and transport properties of a gas mixture.">

.. only:: html

  .. image:: /examples/fortran/images/thumb/sphx_glr_demo_thumb.png
    :alt:

  :ref:`sphx_glr_examples_fortran_demo.f90`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fortran 90 demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This file is an example of how to write an interface to use Cantera in Fortran 77 programs. The basic idea is to store pointers to Cantera objects in global storage, and then create Fortran-callable functions that access the objects through the pointers.">

.. only:: html

  .. image:: /examples/fortran/images/thumb/sphx_glr_demo_ftnlib_thumb.png
    :alt:

  :ref:`sphx_glr_examples_fortran_demo_ftnlib.cpp`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fortran 77 wrapper library</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/fortran/isentropic
   /examples/fortran/f77_demo
   /examples/fortran/ctlib
   /examples/fortran/demo
   /examples/fortran/demo_ftnlib


.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-gallery

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download all examples as source code: fortran.zip </examples/fortran/fortran.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
