I want to run some fortran codes with python and am using f2py -c -m for it. However, it seems that only the FUNCTIONs are packed into the .so file, but not the PROGRAM. How can I deal with global variables then? For example, a variable c is put in a module
MODULE nfw
double precision :: c
END MODULE nfw
,is modified in the PROGRAM, and is used by a FUNCTION in the same file implicitly
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 let the function y(x) know about the value of c in python?