[Numpy-discussion] f2py NotImplementedError

andy buzza asbuzza at gmail.com
Sun Jul 24 15:54:49 EDT 2016


Hello all,

I have been trying to compile a relatively simple pair of Fortran files,
one referencing a subroutine from another file (mainmodule.f90 references
othermodule.f90).  I have been able to compile them using a Fortran
compiler, but receive a NotImplementedError when using f2py.

Steps I use for f2py:

$gfortran -shared -o othermodule.so othermodule.f90 -fPIC

$f2py -c -l/path/othermodule -m mainmodule mainmodule.f90

I am running this on linux and wasn't sure how to correct the error.

othermodule.f90

  module moderator

    implicit none
    integer*1 :: i
    integer*8 :: fact,len
    real*8,dimension(:),allocatable :: ex

    contains

      subroutine submarine(ii,ff,exex)

        implicit none
        integer*1 :: ii
        integer*8 :: ff
        real*8 :: exex

        exex=exp(real(ii))/ff

      end subroutine submarine

  end module moderator


mainmodule.f90

  program mains

    use moderator

    implicit none

    len=10
    allocate(ex(len))
    fact=1
    do i=1,len
       fact=fact*i
       call submarine(i,fact,ex(i))
       if (i==1) then
          print*,"here's your ",i,"st number: ",ex(i)
       elseif (i==2) then
          print*,"here's your ",i,"nd number: ",ex(i)
       elseif (i==3) then
          print*,"here's your ",i,"rd number: ",ex(i)
       else
          print*,"here's your ",i,"th number: ",ex(i)
       endif
    enddo
    deallocate(ex)

  end program


Thanks for the help,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160724/016e3ff6/attachment.html>


More information about the NumPy-Discussion mailing list