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


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

in Table To:


© on Tue Oct 7 1997