I want to run some fortran codes with python and use f2py -c -m for this. However, it seems that only FUNCTIONs are packaged in a .so file, but not a PROGRAM . How can I deal with global variables? For example, the variable c is placed in a module
MODULE nfw double precision :: c END MODULE nfw
changes in PROGRAM and is used FUNCTION implicitly in the same file
PROGRAM Compute_Profile USE nfw c = 5.0 END PROGRAM Compute_Profile DOUBLE PRECISION FUNCTION y(x) USE nfw double precision :: x y = c * x return END FUNCTION y
How can I call the y (x) function to know about the value of c in python?
source share