Neil Carlson <[log in to unmask]> asked:
> Is the following code fragment standard conforming if called
> without the optional argument?
>
> subroutine my_sub (stat)
> integer, intent(out), optional :: stat
> ...
> allocate(array(...), stat=stat)
>
> It certainly is if 'allocate' were some subroutine or function
> with optional argument 'stat', but then allocate isn't really
> either of those things. I was surprised when my favorite
> compiler rejected it.
It's not standard yet.
This is the subject of http://j3-fortran.org/doc/meeting/167/04-180.ps,
a proposal for the next revision of Fortran after the 2003 revision
(probably published around 2009). Look at lines 20-22.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.
|