On Wed, Mar 16, 2011 at 09:46, Neal Becker <ndbeck...@gmail.com> wrote:
> Sturla Molden wrote: > > > Den 16.03.2011 13:25, skrev Sturla Molden: > >> > >> Fortran 90 pointers create a view. > >> > >> real*8, target :: array(n,m) > >> real*8, pointer :: view > >> > >> view => array(::2, ::2) > > > > Pardon, the second line should be > > > > real*8, pointer :: view(:,:) > > > > > > Sturla > > Also: > * can it adopt external memory? > What is external memory? > * can it interwork with numpy? (kinda required for this audience) > > You can use f2py, swig, ctypes, or just Python extension to invoke Fortran code and pass numpy arrays to it and get them back. Not sure whether or not Cython has Fortran support, but Cython can be used as a simplified approach of Python extension. Usually numpy arrays are allocated on heap. In this way we can minimize allocate()/deallocate() inside Fortran subroutines and let Python to do the memory management. Fortran pointers are more like a view rather than C pointers which point to the beginning of a memory block. yyc _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > -- Yung-Yu Chen PhD candidate of Mechanical Engineering The Ohio State University, Columbus, Ohio +1 (614) 859 2436 http://solvcon.net/yyc/
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion