I had the same problem. For me it works if you declare wp in each subroutine repeatedly. Not very elegant but it works…
module foo
implicit none
private
public :: sum_absolute, twice
contains
pure subroutine sum_absolute(n, x, sum_abs_x)
! return the sum of the absolute values of x
integer, parameter :: wp = kind(1.0d0)
integer , intent(in) :: n
real(kind=wp), intent(in) :: x(n)
real(kind=wp), intent(out) :: sum_abs_x
!f2py intent(in) n
!f2py intent(in) x(n)
!f2py intent(out) sum_abs_x
sum_abs_x = sum(abs(x))
end subroutine sum_absolute
!
pure subroutine twice(n, x, twice_x)
integer, parameter :: wp = kind(1.0d0)
integer , intent(in) :: n
real(kind=wp), intent(in) :: x(n)
real(kind=wp), intent(out) :: twice_x(n)
!f2py intent(in) n
!f2py intent(in) x(n)
!f2py intent(in,out) twice_x(n)
twice_x = 2*x
end subroutine twice
end module foo