Basic HTML version of Foils prepared 17 Sept 1996

Foil 9 More on Fortran90 Arrays and Subroutines

From New CPS615HPF and Fortran90 Discussion Sept 17 96 Basic Simulation Track for Computational Science CPS615 -- Fall Semester 96. by Geoffrey C. Fox, Tom Haupt


One passes "assumed-shape" arrays from calling to callee routines using INTERFACE syntax
INTERFACE
  • SUBROUTINE residual (r,u,f)
    • REAL r(:,:) , u(:,:) , F(:,:)
  • END SUBROUTINE
END INTERFACE is called by
call residual (r,u,f) or
call residual ( r(0:nx:2, 0:ny:2) , u(0:nx:2, 0:ny:2) , f(0:nx:2, 0:ny:2) )
where latter example just processes every other element of arrays



© on Tue Oct 7 1997