Re: [f2py] f2py-users Digest, Vol 60, Issue 3

pavanakumar mohanamuraly <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <C7B13F6D.4AFE%[email protected]>
Hi Strauss,


Yes. Looks like a good option. I have actually put all the 15 files of my
f77 code and made a monolithic file and wrapped it. Seems like a fair option
but haven't tried f2py on the file yet.

Thanks for the tip.

--
Pavanakumar Mohanamuraly

On 2/26/10 3:30 PM, "f2py-users-request-Y4l6ocDipWCuvFJfX82//[email protected]"
<f2py-users-request-Y4l6ocDipWCuvFJfX82//[email protected]> wrote:

> Send f2py-users mailing list submissions to
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cens.ioc.ee/mailman/listinfo/f2py-users
> or, via email, send a message with subject or body 'help' to
> f2py-users-request-Y4l6ocDipWCuvFJfX82//[email protected]
> 
> You can reach the person managing the list at
> f2py-users-owner-Y4l6ocDipWCuvFJfX82//[email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of f2py-users digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: COMMON BLOCK revisited (Charlie E. Strauss)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 25 Feb 2010 08:27:59 -0700 (MST)
> From: "Charlie E. Strauss" <[email protected]>
> Subject: Re: [f2py] COMMON BLOCK revisited
> To: "For users of the f2py program" <f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]>
> Message-ID: <35801.128.165.0.81.1267111679.squirrel-2RFepEojUI1g5Yqs9hTBYw@public.gmane.org>
> Content-Type: text/plain;charset=iso-8859-1
> 
> Why can't you put this all into one module?
> 
>> Hi
>> 
>> I dug the user mailing list and found this post on COMMON BLOCKS:
>> 
>> -------- thread message ----------------------------------------
>>> Pearu,
>>> 
>>> I have the same common blocks in different modules.  I'd like to make
>>> common blocks from both modules reference the same variable.  I can't
>>> seem to do it.
>> 
>> Because it is not possible.
>>> .................
>> No. And it is not due to f2py limitations. Namely COMMON blocks
>> are 'common' only for routines that are inside of the same executable
>> (e.g. shared module). And each time a module is loaded, a memory is
>> allocated for COMMON blocks and pointers inside Fortran routines (inside
>> that module) point to these COMMON blocks, roughly speaking.
>> If you load another module, it will have its own COMMON blocks and
>> pointers in its routines will point to that.
>>> ................
>> Sorry, not possible :( COMMON blocks just are sticked to one executable
>> and I don't see any ways how they could be shared between different
>> executables.
>> ------ end of thread message --------------------------------
>> 
>> I need to wrap a f77 code which has common block declared in almost every
>> subroutine. There are inputs like max dimensions of arrays in the common
>> block used by every subroutine.
>> 
>> So explicitly using assignment to pass the value to every common block in
>> each subroutine is not worth it (but definitely a solution). Changing the
>> code by removing the common block is one thing, but are there other ways ?
>> 
>> Referencing a numpy variable to the variable in the COMMON BLOCK is
>> impossible according to the above post. And assignment of a numpy array to
>> the wrapped COMMON BLOCK array (I believe) copies the contents and does
>> not
>> reference (or is there a way).
>> 
>>>> import WarppedSubroutine
>>>> NumpyReal = 0.1
>>>> WrappedSubroutine.CommonBlock.RealInBlock = NumpyReal
>> 
>> I would appreciate if some one can give some hints.
>> 
>> Regards,
>> 
>> --
>> Pavanakumar Mohanamuraly
>> 
>> 
>> 
>> _______________________________________________
>> f2py-users mailing list
>> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
>> http://cens.ioc.ee/mailman/listinfo/f2py-users
>> 
> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> f2py-users mailing list
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> http://cens.ioc.ee/mailman/listinfo/f2py-users
> 
> 
> End of f2py-users Digest, Vol 60, Issue 3
> *****************************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.