(j3.2006) TS29113 Intent(out) - and finalization/deallocation of allocatable components

Bader, Reinhold Reinhold.Bader
Sun Jun 2 11:33:15 EDT 2013


Hello Tobias, 

I've now found C1255b in section 5.3 of the TS which implies that INTENT(OUT)
with such types as you describe cannot happen. 

Regards
Reinhold

> -----Urspr?ngliche Nachricht-----
> Von: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-
> fortran.org] Im Auftrag von Tobias Burnus
> Gesendet: Freitag, 31. Mai 2013 16:17
> An: fortran standards email list for J3
> Betreff: (j3.2006) TS29113 Intent(out) - and finalization/deallocation of
> allocatable components
> 
> Dear all,
> 
> I stumbled over the following test in TS29113, in section "6.3 Argument
> association" (third and fourth paragraph):
> 
> "When a Fortran procedure that has an INTENT(OUT) allocatable dummy
> argument is invoked by a C function, and the actual argument in the C
> function is the address of a C descriptor that describes an allocated
> allocatable variable, the variable is deallocated on entry to the
> Fortran procedure.
> When a C function is invoked from a Fortran procedure via an interface
> with an INTENT(OUT) allocatable dummy argument, and the actual argument
> in the reference to the C function is an allocated allocatable variable,
> the variable is deallocated on invocation (before execution of the C
> function begins)."
> 
> 
> It seems to be permitted [8.7, (6)(c)] to pass a derived-type which has
> allocatable components/finalizers to C using CFI_type_other - as long it
> is passed as CFI_cdesc_t. Thus, it seems to be valid to hav a dummy
> argument which is non-VALUE, nonallocatable and assumed-shape or
> assumed-rank and has the INTENT(OUT).
> 
> If so, I think it has to be finalized/deallocated - and I believe that
> it should be handled as described  (cf. quote above) in 6.3 for
> allocatable dummy arguments.
> 
> Do you concur? Or have I missed something?
> 
> Tobias
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3



More information about the J3 mailing list