Skip to content

BUG: f2py generation loses intent specs on using --no-lower option #20943

Closed
@dwr-psandhu

Description

@dwr-psandhu

Describe the issue:

f2py generation of .pyf files works with default options but loses the intent specs when --no-lower is specified

See example below, its missing intent specs. If run without the --no-lower option it works fine.

Reproduce the code example:

f2py --no-lower -m testnl -h test_nolower.pyf

E.g. with a test file with this code
MODULE Test_Module
    IMPLICIT NONE
    CONTAINS
  SUBROUTINE Test_Routine(len_fname,fname,iStat) BIND(C,NAME='Test_Routine')
    INTEGER,INTENT(IN)    :: len_fname
    CHARACTER,INTENT(IN) :: fname(len_fname)
    INTEGER,INTENT(OUT)   :: iStat
  END SUBROUTINE
END MODULE

Error message:

!    -*- f90 -*-
! Note: the context of this file is case sensitive.

python module testnl ! in 
    interface  ! in :testnl
        module Test_Module ! in :testnl:test_f2py_intent.f90
            subroutine Test_Routine(len_fname,fname,iStat) ! in :testnl:test_f2py_intent.f90:Test_Module
                integer, optional,check(len(fname)>=len_fname),depend(fname) :: len_fname=len(fname)
                character dimension(len_fname) :: fname
                integer :: iStat
            end subroutine Test_Routine
        end module Test_Module
    end interface 
end python module testnl

! This file was auto-generated with f2py (version:1.21.2).
! See http://cens.ioc.ee/projects/f2py2e/

NumPy/Python version information:

1.21.2 3.7.11 (default, Jul 27 2021, 09:42:29) [MSC v.1916 64 bit (AMD64)]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions