Thanks, Steve, for both the workaround and the promise of an eventual
improvement.
All I'm trying to do is get some data from a namelist and propagate it
throughout the MPI job.
IMO the MPI standard should be able to do something like this
internally with Fortran derived types so you don't have to go through
these shenanigans just to pass data around.
But MPI is somewhat primitive in that respect and has more of an f77/c
flavor. I don't like the size(transfer(...)) syntax either, but one
has to work with the tools available.
Ted
On 16 Dec 2010 11:47:40 -0800, Steve Lionel wrote:
>
> Regarding Ted Stern's email about:
>
> integer :: something_array(size(transfer(something,(/0/))))
>
> All I can say is "I learn something new about the language every day..." I had not realized, until I looked it up, that the TRANSFER in this case returns an array whose size is the smallest possible that is not smaller than the physical representation of "something".
>
> My reading of F2003 suggests that this qualifies as a legal specification expression. I do agree with Aleks that this is "not very nice" and indeed the Intel compiler, at least when I constructed a test case, got heartburn from it. However, the following does work and accomplishes close to the same thing:
>
> integer, allocatable :: something_array(:)
> allocate (something_array(size(transfer(something,(/0/)))))
>
> As a local allocatable, it will be deallocated when the routine exits.
>
> I have passed this on to the developers for correction. Our issue ID is DPD200164371.
>
> Steve Lionel
> Intel Developer Support
> Merrimack, NH
--
Frango ut patefaciam -- I break so that I may reveal
|