Fortran 90 List <[log in to unmask]>
wrote on 06/24/2011 06:27:46 PM:
>
> Neil's problem reveals a deficiency in C_F_POINTER: although the
> shape of the pointer can be set, the deferred length parameters cannot.
>
> If a pointer array is contiguous, why not allow a pointer to the
> array to be a scalar with a length equal to the size of the array,
> or indeed a pointer with any rank, and the product of the length and
> extents equal to the size of the array?
>
> If C_F_POINTER were defined as
>
> C_F_POINTER ( CPTR, FPTR, [SHAPE, PARAMETERS] )
>
> where PARAMETERS is an integer array whose elements give values of
> FPTR's deferred length parameters, Neil's problem would be simple:
That was what I'd like to do as well. Note SHAPE
is not required when the FPTR is a scalar, which certainly can be true
for the string with deferred length. However the heart of the problem
is the interoperable data type doesn't include strings of deferred length.
C_F_POINTER requires FPTR to be a type that is interoperable with
C, and character(:) is not.
Cheers,
Jim Xia
Compiler Testing, X10 & XLF
IBM Toronto Lab at 8200 Warden Ave,
Markham, On, L6G 1C7
905-413-3444