I have Fortran main code. I wish to call a python program from my main Fortran code and pass the array between these two codes.
I have seen several examples of F2py. It seems python codes serve as the main code. As I described before I want it the other way around.
Let us have a subroutine inside the main Fortran code as:
subroutine test(nx,ny,mask)
integer, intent(in) :: nx, ny
integer, dimension(nx,ny), intent(inout) :: mask
call someOperation(nx, ny, mask)
end subroutine test
Now, someOperation is done in python and the multidimensional array with scalar values will be exchanged between Fortran and python.
How can it be done?