F assumes that all functions are pure. If you change something other than
the function result, make it a subroutine.
If "change something" has to include any type of I/O, as the current
definition of "pure" assumes, makes sense is a question that has been
discussed here. Have a look at the archives if you're interested. The gist
is that the compiler can't distinguish between a simple error message and a
permanent change in a file that may be read by a different part of the
program.
Herbert
> -----Original Message-----
> From: Giuseppe Panei [mailto:[log in to unmask]]
> Sent: 17 April 2003 19:13
> To: [log in to unmask]
> Subject: Re: Problem with optional in F
>
>
> Wes
>
> If i remove the optional attribute from the source, I obtain
> the same error: "External file i/o in pure procedure MIA"
>
> Giuseppe
>
> S.G.A.I. S.r.l. di E. Forlani & c.
> via Mariotti 20
> ITALY
> 47833 Morciano di Romagna (RN)
> Tel: 0541988277 Fax: 0541987606
> Web: www.sgai.com Email: [log in to unmask]
>
>
>
>
> ----- Original Message -----
> From: "W. J. Metzger" <[log in to unmask]>
> To: <[log in to unmask]>
> Sent: Thursday 17 April 2003 7:28 PM
> Subject: Re: Problem with optional in F
>
>
> > Hi, Your program works on two fortran compilers, ifc on
> Linux as well as
> > F90 on HPUX. F gives errors (release 20030106 for Linux),
> but not the
> > ones you cite. For me it complains about the two write
> statements in
> > MIA, saying that you are doing external file i/o in a PURE
> procedure.
> > I don't know why it thinks your function is PURE. In any
> case, when I
> > remove the write statements, it compiles.
> >
> > Cheers, Wes
> >
> >
> > On Thu, 17 Apr 2003, Giuseppe Panei wrote:
> >
> > > Dear Mr MAine
> > >
> > > I have attacched the source in a
> > > f90 file
> > >
> > > Regards
> > >
> > > Giuseppe
> >
> > Dr. W. J. Metzger Experimental High Energy Physics Group
> > tel. +31-24-3653127 Faculty of Natural Sciences
> > +31-24-3652099 (secr.) University of Nijmegen
> > fax. +31-24-3652191 Toernooiveld 1
> > telex 48228 wina nl 6525 ED Nijmegen, The Netherlands
> > e-mail: [log in to unmask] or [log in to unmask]
> > http://home.cern.ch/metzger/ or http://www.hef.kun.nl/~wes
>
This e-mail has been scanned by Trend InterScan Software.
This e-mail (and its attachment(s) if any) is intended for the named
addressee(s) only. It may
contain information which is privileged and confidential within the
meaning of the applicable law.
Unauthorised use, copying or disclosure is strictly prohibited and may
be unlawful.
If you are not the intended recipient please delete this email and
contact the sender via email return.
Fujitsu Laboratories of Europe Ltd (FLE) does not accept responsibility
for changes made to this email after
it was sent. The views expressed in this email may not necessarily be
the views held by FLE.
Unless expressly stated otherwise, this email does not form part of a
legally binding contract
or agreement between the recipient and Fujitsu Laboratories of Europe Ltd (FLE).
|