(j3.2006) Final subroutines and coarrays
Bill Long
longb
Mon Feb 6 09:04:10 EST 2012
On 2/5/12 8:59 AM, Tobias Burnus wrote:
> Dear all,
>
> if I correctly read the F2008 standard, one is allowed to have a FINAL
> subroutine with a dummy argument which is a coarray. If one has such a
> variable, it would be only finalized if it is a coarray. (or if the
> variable is an array and there is an elemental FINAL subroutine).
>
I think there may be a defect/omission in the standard here. You are
not allowed to have an elemental FINAL routine with a coarray argument
(C1289). A coarray dummy argument to a nonelemental FINAL routine seems
problematic. Coarray and a TKR compatible noncoarray dummy argument are
not distinguishable for the purposes of generic resolution since a
coarray actual can correspond to either a coarray or a noncoarray dummy.
So, allowing a coarray dummy argument would seem to rule out the
possibility of having a nonelemental FINAL routine for noncoarray
objects of the type. I don't think we really intended that. Further, I
don't see a benefit to having a coarray dummy for a FINAL routine. The
standard should have disallowed it.
Cheers,
Bill
> Do I read the Fortran standard correctly? Or is there something hidden,
> which disallows coarrays as dummy argument of a FINAL subroutine?
>
> Tobias
>
> PS: WG5/N1830 has:
>
> C480 (R452) A final-subroutine-name shall be the name of a module
> procedure with exactly one dummy argument. That argument shall be
> nonoptional and shall be a nonpointer, nonallocatable, nonpolymorphic
> variable of the derived type being defined. All length type parameters
> of the dummy argument shall be assumed. The dummy argument shall not
> have the INTENT (OUT) or VALUE attribute.
>
> C482 (R452) A final subroutine shall not have a dummy argument with the
> same kind type parameters and rank as the dummy argument of another
> final subroutine of that type.
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
More information about the J3
mailing list