(j3.2006) F2008, ALLOCATE with MOLD

Tobias Burnus burnus at net-b.de
Tue Mar 16 08:46:10 EDT 2010


Hello,

does the Fortran 2008 draft FDIS (N1814) actually state anywhere what
MOLD= in the ALLOCATE statement actually does?

I only find

R627 alloc-opt  is  ERRMSG = errmsg-variable
                or  MOLD = source-expr
                or  SOURCE = source-expr
                or  STAT = stat-variable

and later on page 128, paragraph 8:

"If MOLD= appears and source-expr is a variable, its value need not be
defined."


Admittedly, the standard does write something about it: In the
"Introduction" (page xiii, paragraph 2, 5th item):

"A structure constructor can omit the value for an allocatable
component. SOURCE= in an ALLOCATE
statement can give an array variable the bounds as well as the value of
an expression. MOLD= in an ALLOCATE statement can give a polymorphic
variable the shape, type, and type parameters of an expression without
copying the value."

Is it really intended that only the introduction defines the behaviour?

Tobias


More information about the J3 mailing list