Index of Fortran Examples
This is an index of the Fortran examples included with Cantera.
Examples ¶
CKLIB emulation
This example shows how to implement subroutines that emulate those of the Chemkin CKLIB library. This may be useful to port an existing Chemkin-based application to Cantera. As shown here, the subroutine names begin with 'ct' instead of 'ck', so that Cantera and CKLIB subroutines can be both used in an application, if desired. It is also possible to rename these subroutines with the 'ck' prefix if the application is not linked to the Chemkin CKLIB library. In this case, application programs do not need to be modified or recompiled - they only need to be relinked.
Fortran 77 Demo
This program uses functions defined in demo_ftnlib.cpp to create an ideal gas mixture and print some of its properties.
demo_ftnlib.cpp
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.
Isentropic Flow
Calculated Mach number vs. area for an isentropic flow. Relies on the wrapper functions defined in demo_ftnlib.cpp to call the Cantera C++ interface. See also the Python version of this problem in the Python examples.
Fortran 90 Demo
This program illustrates using Cantera in Fortran 90 to compute thermodynamic, kinetic, and transport properties of a gas mixture.