----- Original Message -----
From: "Roland Schilling" <[log in to unmask]>
To: <[log in to unmask]>
Sent: 06 March 2003 11:03
Subject: Re: Questions concerning FORALL
OK, I see the point. I didn't properly distinguish between 'Statement'
and 'Intrinsic Function'. But still the question remains why the mask
in FORALL couldn't be an optional argument of a subroutine or function
that sometimes is present and sometimes not. (The same question would
apply to the stride in a DO construct.) So far I found out that the
NAG and the Intel F95 compilers do not allow the use of the FORALL mask
as an optional argument of a routine, but IBM's XLF95 does allow it!
Has this to be considered an extension to the standard?
====================================================
I would think rather that it's an oversight and not guaranteed to work.
If you want an optional mask, and you don't have too many FORALL statements,
then you can always use a structure like:
SUBROUTINE S(........, MASK,...)
LOGICAL, OPTIONAL, DIMENSION(:) :: MASK
:
IF(PRESENT(MASK)) THEN
FORALL(..., MASK) ....
ELSE
FORALL(...) ...
END IF
This is no different to using, or avoiding using, any optional value in any
expression.
Regards,
Mike Metcalf
|