You're not specifying "explicit use of double precision" -- I would argue that you're specifying "implicit use of double precision" and numpy/f2py has no way of knowing the datatype. In this case, it is likely that f2py is guessing the datatype is float32, so only the first 32 bits of your (64-bit) parameter are actually being interpreted. You can see the same effect if you pass a double precision number to a function which expects a float:
program main
real*8 :: foo
foo = 12345.
call printme(foo)
end program
subroutine printme(foo)
real foo
print*, foo
end subroutine printme
compile and run:
gfortran test2.f90
./a.out #prints 0.00000
The take-away here is that you're expecting f2py
to know how to interpret fortran code and also how to interpret commandline arguments for a particular compiler. We might be able to argue that this type of support would be useful for a small set of compilers -- Unfortunately, it is currently not supported by f2py
.
You need to declare all of your parameters and arguments to be a specific type and changing them on the command line will likely result in the kinds of errors that you see above.