ObjexxFPL: Objexx Fortran-Python Library
The ObjexxFPL is an open source Python library that provides Fortran-compatible array, string, formatted i/o, and intrinsic function support for Fortran-to-Python migrations and some additional components and capabilities to support reengineering and modernization of technical Python applications.
The ObjexxFPL provides the array, string, and intrinsic function support for Objexx Fortran-to-Python conversions and Fortran—Python integration. The key ObjexxFPL capabilities are described below.
Global & Logical Unit I/O
The ObjexxFPL includes Fortranic global and logical unit i/o support including functions such as open, read, write, inquire, backspace, rewind, flush, and close.
The ObjexxFPL has a Fortran-compatible formatted i/o system that provides both very complete Fortran formatting support and excellent integration with native Python stream i/o.
The ObjexxFPL provides Fortranic list-directed i/o.
The ObjexxFPL provides a BinaryFile class that supports Fortranic binary i/o.
Direct Access I/O
The ObjexxFPL provides a DirectAccessFile class that supports Fortranic record-based, formatted and binary direct access i/o.
The ObjexxFPL provides wide coverage of Fortran 77-2018 intrinsic functions.
In addition to the Fortran intrinsic support the ObjexxFPL has a set of useful math/numeric, string, and character functions.
Most Fortran-to-Python conversions use the option of migration to NumPy arrays but the ObjexxFPL provides a more Fortranic array emulation for cases where that is preferred.
ObjexxFPL Arrays have the attributes of Fortran 77-2018 arrays, including:
- Each dimension can have an arbitrary index range.
- Column major element ordering: Nested loops ordered to provide efficient contiguous element access are still efficient in the Python.
- Array passing "tricks": Arrays and array elements can be passed to functions where they are declared with a different rank or dimensions.
- Assumed size array arguments.
- Assumed shape array arguments.
- Array slice (section) support.
ObjexxFPL Array uses a NumPy array internally but there is a performance overhead for the Fortranic emulation.
Most Fortran-to-Python conversions use the option of migration to native Python strings but the ObjexxFPL provides a more Fortranic string emulation for cases where that is preferred.
Fstrings have the attributes of Fortran strings, including:
- Fixed length.
- Character indexing starts from 1.
- "Live" substrings.
- Concatenation support.
- Trailing space is ignored by comparison operations.
The ObjexxFPL is written in Python 3 and is compatible with all platforms with recent Python 3 versions.
The ObjexxFPL is included with our Fortran-to-Python conversion projects and can be licensed separately. The ObjexxFPL is provided in Python source form with a perpetual, royalty-free license.
Contact Objexx for current ObjexxFPL licensing information.