(j3.2006) Did we intend to prohibit this?
Tue Mar 14 00:49:17 EDT 2017
As I wrote before, "it" the value does not get "deallocated", it's just a
value. Not a variable.
There really is nothing difficult going on here. It is the local variable
inside the function that is allocatable and thus gets deallocated.
Is it really necessary to be this way? Yes.
From: Van Snyder
Sent: Tuesday, March 14, 2017 12:58 PM
To: fortran standards email list for J3
Subject: Re: (j3.2006) Did we intend to prohibit this?
On Tue, 2017-03-14 at 10:07 +0900, Cohen Malcolm wrote:
> > then the result variable of F(X) in
> > call move_alloc ( f(x), v )
> >IS a variable, right? So what's the problem with executing it?
> That is not standard-conforming because
> (1) "f(x)" is not even a variable, let alone definable;
> (2) "f(x)" does not have the ALLOCATABLE attribute.
Then how is it possible to deallocate it?
> As explained earlier, MOVE_ALLOC requires both arguments to be
> definable variables, by virtue of the INTENT specification.
Is it really necessary for it to be this way? Is there a technical
call move_alloc ( f(x), v )
v = f(x)
It seems desirable to avoid deallocating v, reallocating it to the same
shape as f(x), copying the value, and deallocating the result of f(x).
J3 mailing list
J3 at mailman.j3-fortran.org
This e-mail has been scanned for all viruses by Star.
.............Malcolm Cohen, NAG Oxford/Tokyo.
More information about the J3