Gfort2py Versions Save

Library to allow calling fortran code from python

v2.5.0

2 months ago
  • Fix bug when returning a derived type containing an allocatable array
  • Raise AttributeError instead of IndexError when trying to slice scalar derived type
  • Better error message when passing wrong number of arguments to a procedure
  • Fotran names are now treated as case insensitive
  • Debug output now uses Python's logging module

v2.4.2

3 months ago
  • Add support for new platforms
  • Switch compile function to be mostly keyword only arguments
  • Various packages needed for building have had their minimum version bumped
  • mod data can now be exported as JSON

v2.4.1

5 months ago
  • Add support for callback functions
  • Allows access to bind(C) variables and functions

v2.4.0

6 months ago
  • Adds the ability to load Fortran code from either a string or file. This avoids the user needing to have to compile and build a shared library themselves.
  • Update to support Python 3.12
  • Update to support gfortran 13

v2.3.0

7 months ago
  • Initial support for quad precision variables
  • Switch from pyparsing to cpyparsing for faster loading of the mod files
  • Add caching option of mod files for faster startups
  • Fix bug in optional character dummy arguments
  • Fix bug when we need to re-resolve runtime arguments

v2.2.1

8 months ago

Fix issue with assumed shape character arrays

v2.2.0

10 months ago

Add support for complex parameter arrays

Expand the kinds supported for integers, reals, and complex numbers

Allow functions to return an array as a result

v2.1.0

10 months ago

Fixes bugs in logical parameters

Enables support for runtime-defined explicit arrays where the dimension requires evaluating a unary op i.e dimension(n+1) or dimension((n*2)+1)

Be more careful about using np.double for double-precision variables

v2.0.0

10 months ago

After many years (and several complete re-writes) I am pleased to announce the release gfort2py v2.0.0. gfort2py is a Python library enabling the calling of Fortran code from Python. The main aim of this library is to make calling the Fortran code as easy as possible by minimising the number of changes to the Fortran code. All that is required is to have your code in a module and compiled as a shared library. No annotations or other changes needed.

Source code is available at https://github.com/rjfarmer/gfort2py

Gfort2py works with python >=3.7 and gfortran >=8. Note that there are many API breakages with the gfort2py 1.. series. Please refer to the README at https://github.com/rjfarmer/gfort2py/blob/main/README.md for examples of the new features.

Gfort2py supports many modern (and old) Fortran features including:

Scalars (ints, reals, logicals, characters) Arrays of (ints, reals, logicals, characters): explicit, assumed shape, assumed size, and allocatable arrays. Derived types including scalars and arrays. Explicit arrays of derived types (assumed shape are not yet supported) Allocatable strings (partial support) Calling functions and subroutines.

More features are planned to be added over time.

Installation via pip: python -m pip install --upgrade gfort2py

For those that want to get involved: Improvements to the test suite to include untested or new Fortran features (and Python code to test those features, even if it doesn’t yet work) is the most helpful. Otherwise, bug reports on broken features are also helpful.

v1.1.5

4 years ago

Fix the build requirements Make ints and floats behave like ints and floats