TF++, Miscellaneous classes and modules in C++:
FORTRAN I/O functions

FORTRAN file data input and output functions. More...

Collaboration diagram for FORTRAN I/O functions:

Modules

 Interface provided through bytesex.h
 Interface provided through bytesex.h,.
 
 Interface provided through complexio.h
 Interface provided through complexio.h.
 
 Interface provided through fortranio.h
 Interface provided through fortranio.h,.
 

Namespaces

 tfxx::fortranio
 contains all FORTRAN file data input output functions ,
 

Classes

struct  tfxx::fortranio::blitz_magic< T, N >
 magic numbers for blitz array I/OPlease define TF_COMPLEX_ARRAY to activate I/O for arrays of complex types. More...
 
class  tfxx::fortranio::FortranBinInput
 read FORTRAN binary data ,This class reads FORTRAN binary data. FORTRAN binary data is always written in chunks of several bytes, where each chunk is preceded and followed by a 4-byte integer byte-count. This class takes care of this structure of byte-counts an returns only the real data (omitting the counts). More...
 
class  tfxx::fortranio::FortranBinOutput
 write FORTRAN binary data ,This class writes FORTRAN binary data. FORTRAN binary data is always written in chunks of several bytes, where each chunk is preceded and followed by a 4-byte integer byte-count. This class takes care of this structure of byte-counts. More...
 

Functions

template<class T , int N>
tfxx::fortranio::FortranBinOutputtfxx::fortranio::operator<< (tfxx::fortranio::FortranBinOutput &fo, const blitz::Array< T, N > &a)
 Output operator template for class FortranBinOutput and blitz. More...
 
template<class T , int N>
tfxx::fortranio::FortranBinInputtfxx::fortranio::operator>> (tfxx::fortranio::FortranBinInput &fi, blitz::Array< T, N > &a)
 Input operator template for class FortranBinInput and blitz. More...
 

Detailed Description

FORTRAN file data input and output functions.

Since
November 2002

The functions in this group serve mainly to read FORTRAN binary data files into C++ variables or arrays. There may be also writing functions and functions for FORTRAN formatted ASCII files added. This module makes extensive use of the I/O byte swapping facility.

I/O is most easily accomplished by using the overloaded versions of the I/O input and output operators. For I/O of complex types specialized versions are presented in complexio.h. These operators are placed in the global namespace.

Test of I/O-routines
The I/O routines where testet on 20/11/2002. The test code may be found in tests/fortraniotest.cc, which is documented in TEST: Fortran I/O and byte swapping., and in tests/fortranF77.f, which is the Fortran 77 part of the test module. The Fortran part was compiled and run on two systems:
  1. AIX geo31 3 4 002030455700 (Motorola CPU)
  2. Linux geo19 2.4.4-64GB-SMP #1 SMP i686 unknown (Intel CPU)

The C++ part of the test was only compiled on the Linux machine. The test was successfully passed for magic numbers, I/O and byteswapping I/O (from/to Fortran77/C++ and Motorola/Intel) performed with the following C++ types:

  1. int
  2. long int
  3. long long int
  4. float
  5. double
  6. complex<float>
  7. complex<double>
See also
TEST: Fortran I/O and byte swapping.
tfxx::fortranio::FortranBinOutput& operator<<(tfxx::fortranio::FortranBinOutput&, T&)
tfxx::fortranio::FortranBinInput& operator>>(tfxx::fortranio::FortranBinInput&, const T&)