On Thu, May 5, 2011 at 11:51 PM, DJ Luscher <d...@lanl.gov> wrote:

>
> Ralf Gommers <ralf.gommers <at> googlemail.com> writes:
>
> >
> > Hi,
> >
> > I am pleased to announce the availability of the second release
> > candidate of NumPy 1.6.0.
> >
> > Compared to the first release candidate, one segfault on (32-bit
> > Windows + MSVC) and several memory leaks were fixed. If no new
> > problems are reported, the final release will be in one week.
> >
> > Sources and binaries can be found at
> > http://sourceforge.net/projects/numpy/files/NumPy/1.6.0rc2/
> > For (preliminary) release notes see below.
> >
> > Enjoy,
> > Ralf
> >
> > =========================
> > NumPy 1.6.0 Release Notes
> > =========================
> >
> > Fortran assumed shape array and size function support in ``numpy.f2py``
> > -----------------------------------------------------------------------
> >
> > F2py now supports wrapping Fortran 90 routines that use assumed shape
> > arrays.  Before such routines could be called from Python but the
> > corresponding Fortran routines received assumed shape arrays as zero
> > length arrays which caused unpredicted results. Thanks to Lorenz
> > Hüdepohl for pointing out the correct way to interface routines with
> > assumed shape arrays.
> >
> > In addition, f2py interprets Fortran expression ``size(array, dim)``
> > as ``shape(array, dim-1)`` which makes it possible to automatically
> > wrap Fortran routines that use two argument ``size`` function in
> > dimension specifications. Before users were forced to apply this
> > mapping manually.
> >
>
>
> Regarding the f2py support for assumed shape arrays:
>
> I'm just struggling along trying to learn how to use f2py to interface with
> fortran source, so please be patient if I am missing something obvious.
>  That
> said, in test cases I've run the new f2py assumed-shape-array support in
> Numpy
> 1.6.0.rc2 seems to conflict with the support for f90-style modules.  For
> example:
>
> <foo_mod.f90>
>
>       ! -*- fix -*-
>
>       module easy
>
>       real, parameter :: anx(4) = (/1.,2.,3.,4./)
>
>       contains
>
>       subroutine sum(x, res)
>         implicit none
>         real, intent(in) :: x(:)
>         real, intent(out) :: res
>
>         integer :: i
>
>         !print *, "sum: size(x) = ", size(x)
>
>         res = 0.0
>
>         do i = 1, size(x)
>           res = res + x(i)
>         enddo
>
>       end subroutine sum
>
>       end module easy
>
>
> when compiled with:
> f2py -c --fcompiler=intelem foo_mod.f90  -m e
>
> then:
>
> python
> import e
> print e.easy.sum(e.easy.anx)
>
> returns: 0.0
>
> Also (and I believe related) f2py can no longer compile source with assumed
> shape array valued functions within a module.  Even though the python
> wrapped
> code did not function properly when called from python, it did work when
> called
> from other fortran code.  It seems that the interface has been broken.  The
> previous version of Numpy I was using was 1.3.0 all on Ubuntu 10.04, Python
> 2.6,
> and using Intel fortran compiler.
>
> thanks for your consideration and feedback.
>
>
Thanks for the bug report!

These issues are now fixed in:

  https://github.com/numpy/numpy/commit/f393b604

Ralf, feel free to apply this changeset to 1.6.x branch if appropriate.

Regards,
Pearu
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to