Basic HTML version of Foils prepared August 7 98

Foil 13 D. PURE functions
PURE Functions

From DoD HPF Training -- 3. Parallel Constructs in HPF DoD Training and Others -- 1995-98. by Chuck Koelbel -- Rice University


1 Syntax:
  • PURE [type-spec] FUNCTION function-name( [ dummy-arg-name-list ] )
2 PURE functions have no side effects
3 Syntactic constraints:
  • Global variables and dummy arguments cannot be used in any context that may cause the variable to become defined
    • Left hand side of assignment
    • DO index, ASSIGN, ALLOCATE
    • Actual argument with INTENT(OUT)
    • Targets of pointer assignments (due to later use of pointers)
    • Full list of restrictions is too long to fit on this slide!
  • No external I/O or file operations
  • Only inherited distribution/alignment of dummies and locals
4 Intrinsic functions are PURE

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Aug 9 1998