Basic HTML version of Foils prepared 26 September 1996

Foil 26 MODULEs INTERFACES and Overloaded Operators in Fortran90

From HPCC Software Technologies Fall 96 -- Overview and HPF Delivered Lectures of CPS615 Basic Simulation Track for Computational Science -- 26 September 96. by Geoffrey C. Fox


MODULE INTERVAL_ARITHMETIC
  • TYPE INTERVAL
    • REAL LOWER, UPPER
  • END TYPE INTERVAL
  • INTERFACE OPERATOR(+) define overloaded + operator
    • MODULE PROCEDURE ADD_INTERVALS
  • END INTERFACE
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)
END MODULE INTERVAL_ARITHMETIC



© 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 Feb 22 1998