FFIO Library

Author: Shishir A. Pandya and Chase P. Ashby

Description:

The FFIO library is a Fortran95 compliant library for I/O of all kinds of files related to computational simulations using overset meshes. Such files include:
Grid Solution Triangulation X-ray Connectivity
PLOT3D (0) PLOT3D Function (9) Cart3D Tri (30) OVERFLOW (20) INTOUT (21)
PLOT3D Q (10) Extended Tri files (32) XINTOUT (22)
OVERFLOW(<ver1.7e) (11) Cart3D Triq (33)
OVERFLOW(ver1.7e-2.0p) (12) FAST (35)
OVERFLOW(ver.2.0p-) (13) UCD (36)
OVERFLOW with restart (14) STL (37)
OVERFLOW Q-average (15)

The FFIO library routines that determine file type return a fltype variable. The values in the parenthesis correspond to the value of fltype for that file type.

The intent of the library is as follows:

Prior to FFIO: Behavior of CGT programs using standard I/O:

Endian: Prior to FFIO Precision: Prior to FFIO

FFIO-enabled CGT programs behavior:

Input File Endian Output File Endian
little little
big big
no input file or ASCII machine native

Code Precision Input File Precision Output File Precision
single single single
single * double double
single no input file or ASCII single
double ** single single
double double double
double no input file or ASCII double

* A single precision code will convert double precision data to single precision internally and perform all computations in single precision. The user should avoid this demotion of the data.

** A double precision code will convert single precision data to double precision internally and perform all computations in double precision. The data is converted back to single precision in the output file. Such conversion is considered 'safe'.

There are situations where a code is reading more than one file. For example, one can use the combinex code to append a grid in file B.dat to a grid in file A.dat. To do this, file A is read first and all attributes are set by that file. If the attributes of file B are different from file A (e.g. file A is little-endian, while file B is big-endian), then the output file follows the endian of the first file (file A). This choice was made with the idea that file A is being worked on or append to, so file A's attributes should be retained in the output.

Note that all ASCII output follows the precision of the code; except for triangulations. All triangulations are assumed to be single precision for both input and output.

Set output endian and/or precision using environment variables:

If the user desires to always have a given output behavior for endian and precision, FFIO provides two environment variables: CGT_OUTPUT_ENDIAN and CGT_OUTPUT_PRECISION.
Machine Endian CGT_OUTPUT_ENDIAN Output Endian
little LITTLE litle
big LITTLE litle
little BIG big
big BIG big
little NATIVE litle
big NATIVE big
little INPUT endian of the first file ***
big INPUT endian of the first file ***

Code Precision CGT_OUTPUT_PRECISION Output Precision
single SP (or SINGLE) single
double SP (or SINGLE) single
single * DP (or DOUBLE) double
double ** DP (or DOUBLE) double
single EXEC single
double EXEC double
single INPUT precision of the first file ***
double INPUT precision of the first file ***

*** Default behavior as described above.

Usage:

Both the single and double precision executables are still compiled into the bin_sp and bin_dp directories by the 'make install' command. It is recommended that the average user no longer use the executables in bin_sp. The bin_dp executables should provide all necessary functionality. The only exception to this is if the user has all single precision data and needs the additonal speed and lower memory requirements of the single-precision code.

Codes converted to use FFIO:

Code development with FFIO:

A code developer attempting to use the FFIO library has a large amount of capability at his/her fingertips. However, such a large capabiity also means a large number of callable API routines.

Imlementation details:

For implementation details please see the FFIO.pdf file.


Last modified: Thu Feb 5 17:01:15 PST 2026