JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for COMP-FORTRAN-90 Archives


COMP-FORTRAN-90 Archives

COMP-FORTRAN-90 Archives


COMP-FORTRAN-90@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

COMP-FORTRAN-90 Home

COMP-FORTRAN-90 Home

COMP-FORTRAN-90  1997

COMP-FORTRAN-90 1997

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Another annoying F90 missing feature

From:

Swietanowski Artur <[log in to unmask]>

Reply-To:

Swietanowski Artur <[log in to unmask]>

Date:

Thu, 30 Oct 1997 22:46:18 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (75 lines)

William B. Clodius wrote:
> <SNIP>
> Not quite true. User functions and user subroutines could only be used 
> for initialization (without a large potential for error) under 
> restricted conditions. It is possible that user defined PURE 
> procedures could be used for this, but I suspect that something closer 
> to mathematical pureness (IDEAL?) would really be needed.

I'd say that PUREness in context of module data initialization 
is already too much of a straightjacket. After all some of the 
requirements of PURE functions are motivated by FORALL statement, 
where it is anticipated that a number of PURE procedures may 
be executing in parallel. But there's no chance of that happening 
here.

A PURE function/subroutine:
a) if a function, does not alter dummy arguments,
b) does not alter host- or use-associated variables,
c) contains no locals with SAVE attribute,
d) contains no STOP,
e) performs no external I/O.

For the specific purpose of module initialization the above 
conditions can be (I hope) significantly relaxed:
a) can be left as is, but I'm mostly interested in initialization 
   subroutines now,
b) is hardly acceptable for a module initialization procedure, 
   which would (preferably) take no arguments and would be allowed 
   to modify any host associated data (and perhaps also use-associated 
   data) any way it wishes.

   The alternative when the initialization subroutine would take 
   all module wide data as its arguments (possibly with INTENT(OUT)) 
   seems clumsy.
c) OK, but meaningless. After all an initialization procedure I have 
   in mind would only be called once.
d) I think it is superfluous in the context. The initialization 
   subroutine might determine that the current setting of parameters 
   (yes, PARAMETERS) does not allow sensible initialization of 
   a module (e.g., the currently defined KINDS of foating point data 
   provide insuficient accuracy for the module) should be allowed 
   to STOP. 
e) Hmm, I could think of good uses for external I/O. How about 
   library licence checking via licence file reading?

Thus, the procedures called from within initialization subroutine 
don't need to be pure either.

The bottom line with module initialization procedures is in my 
opinion the following:
  Their call perfomed automatically before the beginning of 
  the program should be exactly the same as if they were called 
  explicitly in a well defined order at the beginning of 
  the program. The only difference would be such that those and 
  only those procedures would be allowed to modify module-wide 
  data with a CONSTANT attribute. And that would be the only 
  restriction I'd recommend.

The reasons for prefering such solution to hand coding remain:
a) it's impossible to initialize constants with many useful 
   expressions now,
b) it's error prone to rely on manual initialization of module 
   data.

Regards,
Artur Swietanowski
----------------------------------------------------------------------
Artur Swietanowski                mailto:[log in to unmask]
Institut fuer Statistik,  Operations Research und Computerverfahren,
Universitaet Wien,  Universitaetsstr. 5,  A-1010 Wien,  Austria
tel. +43 (1) 407 63 55 - 120      fax  +43 (1) 406 41 59
----------------------------------------------------------------------


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Top of Message | Previous Page | Permalink

JISCMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
July 2013
June 2013
May 2013
April 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
August 2010
July 2010
June 2010
March 2010
February 2010
January 2010
December 2009
October 2009
August 2009
July 2009
June 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997


WWW.JISCMAIL.AC.UK

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager