(j3.2006) Still illegal in F08?

Malcolm Cohen malcolm
Tue Jan 5 21:18:36 EST 2010

Van Snyder wrote:
> subroutine S ( X, A )
>  real :: X(:)
>  real, optional :: A(:)
>  real :: B(merge(size(x),0,present(a))
> end subroutine S
>> Even though we expanded the list of inquiry functions to include them
>> all, it seems that this is still illegal in F2008 because A is optional
>> and therefore not a restricted expression,


>> and "present" doesn't return
>> an integer result and therefore the "present(A)" argument of "merge"
>> isn't a restricted expression.

Huh?  There is no mention of "integer result".

>>  Item (9)(b)(3) in 7.1.11p2 on page 150
>> in 09-007r3 appears to be the killer.

Quite the reverse.

PRESENT is an intrinsic inquiry function, and therefore a specification inquiry, 
and the property of A being inquired about is certainly
(i) NOT dependent on the upper bound of the last dimension of an assumed-size 
(ii) NOT deferred, and
(iii) NOT defined by an expression that is not a restricted expression.

Therefore by 9(b) PRESENT(A) is a restricted expression,
and therefore MERGE(1,2,PRESENT(A)) is also a restricted expression
and thus by R728 a <specification-expr>.

................................Malcolm Cohen, Nihon NAG, Tokyo.

More information about the J3 mailing list