f2py: Specifying real precision in fortran when interfacing with python?
问题 I am playing around with f2py. I'm a bit confused about numpy intrinsic types vs. fortran 90 types. It seems like I can only use single precision reals in fortran 90, when interacting with python. Let me illustrate with an example: Say I have this fortran 90 module, test.f90, to be compiled with f2py and imported in python: module test implicit none integer, parameter :: sp = selected_real_kind(6,37) ! single precision integer, parameter :: dp = selected_real_kind(15,307) ! double precision