On Tue, Jul 3, 2012 at 9:51 PM, Paul Anton Letnes
wrote:
>
> On 4. juli 2012, at 02:23, Sturla Molden wrote:
>
>> Den 03.07.2012 20:38, skrev Casey W. Stark:
>>>
>>> Sturla, this is valid Fortran, but I agree it might just be a bad
>>> idea. The Fortran 90/95 Explained book mentions this in the
>>
On Tue, Jul 3, 2012 at 5:27 PM, Sturla Molden wrote:
> Den 04.07.2012 01:59, skrev Sturla Molden:
>> But neither was the case here. The allocatable was a dummy variable in
>> a subroutine's interface, declared with intent(out). That is an error
>> the compiler should trap, because it is doomed to
Hi all.
Thanks for the help again. I ended up going with running it twice -- once
for the final number of particles and second for the positions.
Sturla, given that this functionality is so standard dependent, I decided
to ditch it. It works with my gfortran, but who knows with other machines
and
On 4. juli 2012, at 02:23, Sturla Molden wrote:
> Den 03.07.2012 20:38, skrev Casey W. Stark:
>>
>> Sturla, this is valid Fortran, but I agree it might just be a bad
>> idea. The Fortran 90/95 Explained book mentions this in the
>> allocatable dummy arguments section and has an example using a
Den 04.07.2012 01:59, skrev Sturla Molden:
> But neither was the case here. The allocatable was a dummy variable in
> a subroutine's interface, declared with intent(out). That is an error
> the compiler should trap, because it is doomed to segfault.
Ok, so the answer here seems to be:
In Fortra
Den 03.07.2012 20:38, skrev Casey W. Stark:
>
> Sturla, this is valid Fortran, but I agree it might just be a bad
> idea. The Fortran 90/95 Explained book mentions this in the
> allocatable dummy arguments section and has an example using an array
> with allocatable, intent(out) in a subrountine
Den 03.07.2012 19:24, skrev Pearu Peterson:
>
> One can have allocatable arrays in module data block, for instance, where
> they a global
In Fortran 2003 one can also have allocatable arrays as members in
derived types.
But neither was the case here. The allocatable was a dummy variable in a
su
Hi all.
Thanks for the speedy responses! I'll try to respond to all...
The first idea is to split up the routine into two -- one to compute the
final size of the arrays, and the second to fill them in. I might end up
doing this, because it is simplest, but it means creating the initial
conditions
On Tue, Jul 3, 2012 at 5:20 PM, Sturla Molden wrote:
>
> As for f2py: Allocatable arrays are local variables for internal use,
> and they are not a part of the subroutine's calling interface. f2py only
> needs to know about the interface, not the local variables.
>
One can have allocatable array
Den 03.07.2012 11:54, skrev George Nurser:
>> module zp
>>implicit none
>>contains
>>subroutine ics(..., num_particles, particle_mass, positions, velocities)
>> use data_types, only : dp
>> implicit none
>> ... inputs ...
>> integer, intent(out) :: num_particles
>>
On 7/2/2012 7:17 PM, Casey W. Stark wrote:
Hi numpy.
Does anyone know if f2py supports allocatable arrays, allocated inside
fortran subroutines? The old f2py docs seem to indicate that the
allocatable array must be created with numpy, and dropped in the
module. Here's more background to expla
> Hi numpy.
>
> Does anyone know if f2py supports allocatable arrays, allocated inside
> fortran subroutines? The old f2py docs seem to indicate that the
> allocatable array must be created with numpy, and dropped in the module.
> Here's more background to explain...
>
> I have a fortran subroutine
Can you interface your fortran program twice?
First time return the number of particles, dimensions etc to python
python then creates work array of right size
Second interface pass work array as in/out array, dimension in fortran
argument list, to fortran
fortran copies allocatable arrays to arg
Hi numpy.
Does anyone know if f2py supports allocatable arrays, allocated inside
fortran subroutines? The old f2py docs seem to indicate that the
allocatable array must be created with numpy, and dropped in the module.
Here's more background to explain...
I have a fortran subroutine that returns
14 matches
Mail list logo