Basic HTML version of Foils prepared 17 Sept 1996

Foil 8 Fortran90 Arrays and Memory Allocation

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


ALLOCATABLE Arrays can be defined at runtime with variable sizing
  • REAL, ALLOCATABLE :: u(:,:) , f(:,:)
  • ALLOCATE ( u(0:nx,0:ny) , f(1:27,0:ny) )
One can define POINTER and TARGET attributes which can be used like REAL, DIMENSION etc.
  • => operator allows one to set a POINTER to "point to" a TARGET
Arguments of a subroutine need NOT define array dimensions in subroutine as these as passed by calling program in data descriptor
Local arrays are created on stack and bounds maybe non constant and evaluated at procedure entry



© on Tue Oct 7 1997