Pass arrays from C/C++ to Fortran and return a calculated array

Under the rules of current Fortran (Fortran 2008, but this is the same for when C interoperability was introduced in Fortran 2003), a Fortran procedure is not interoperable with C if it has an assumed shape dummy argument (other restrictions also apply). In your code degC, the dummy argument in the function DegCtoF, declared as … Read more

Fortran – Cython Workflow

Here’s a minimum working example. I used gfortran and wrote the compile commands directly into the setup file. gfunc.f90 module gfunc_module implicit none contains subroutine gfunc(x, n, m, a, b, c) double precision, intent(in) :: x integer, intent(in) :: n, m double precision, dimension(n), intent(in) :: a double precision, dimension(m), intent(in) :: b double precision, … Read more