HTML version of Scripted Foils prepared 27 December 1996

Foil 12 MODULEs INTERFACES and Overloaded Operators in Fortran90

From CPS615-Introduction to F90 Features, Rationale for HPF and Problem Architecture Delivered Lectures of CPS615 Basic Simulation Track for Computational Science -- 24 September 96. by Geoffrey C. Fox *
Secs 80.6
1 MODULE INTERVAL_ARITHMETIC
  • TYPE INTERVAL
    • REAL LOWER, UPPER
  • END TYPE INTERVAL
  • INTERFACE OPERATOR(+) define overloaded + operator
    • MODULE PROCEDURE ADD_INTERVALS
  • END INTERFACE
2 CONTAINS
  • FUNCTION ADD_INTERVALS(A,B)
    • TYPE(INTERVAL) ADD_INTERVALS, A, B
    • ADD_INTERVALS%LOWER = A%LOWER + B%LOWER
    • ADD_INTERVALS%UPPER = A%UPPER + B%UPPER
  • END FUNCTION ADD_INTERVALS(A,B)
3 END MODULE INTERVAL_ARITHMETIC

Table Font Size


© 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 Fri Aug 15 1997